LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

A way to get information about colored points from a graph?

Two questions:

 

1. Is there a possibility to know whether a specific point is already plotted in a graph and what is the color of that specific point?
2. Is there a way to use the legend in order to show what each colored point represents (not lines, only colored points..)?

Thank you!

0 Kudos
Message 1 of 5
(4,519 Views)

1. In principle yes but it depends.. How did you plot the data? Using PlotPoint, PlotXY, did you keep the plot handles?

2. A legend belongs to one plot, so if the plot contains more than one point I would assume that this will not work. An alternative might be to use annotations.

0 Kudos
Message 2 of 5
(4,512 Views)

1. I used PlotPoint & a function "returncolor" in order to make each colored point present a different situation depend on variable 'x':

 

double m_abs (double x) {
if (x < 0) return -x;
return x;
}

 

int returncolor (double x) {
if (m_abs(x) <= 0.05) return VAL_GREEN;
if (m_abs(x) <= 0.15 && m_abs(x) > 0.05) return VAL_BLUE;
if (m_abs(x) <= 0.25 && m_abs(x) > 0.15) return VAL_DK_MAGENTA;
return VAL_RED;
}
The problem occurs when PlotPoint used twice for the exact same point with different colors so only the last colored point would remain.

I want that in this case, only the color with the maximum variable 'x': would remain..

Sם I can solve it by saving the data to 2D array.. but I thought maybe there is an option to get true or false whether a point exist on a specific location in a graph or not, and what is the color of that point.
2. Yes, I have already used annotations., but too bad there is no way to put legend for colored points..

0 Kudos
Message 3 of 5
(4,505 Views)

@RaVen88 wrote:
Sם I can solve it by saving the data to 2D array.. but I thought maybe there is an option to get true or false whether a point exist on a specific location in a graph or not, and what is the color of that point.

The only way I am aware of would be to query plot attributes, but this also requires saving an array (of plot handles).

0 Kudos
Message 4 of 5
(4,499 Views)

Thank you!

0 Kudos
Message 5 of 5
(4,490 Views)