08-24-2014 02:28 AM
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!
08-24-2014 10:43 AM
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.
08-24-2014 03:22 PM
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..
08-24-2014 10:43 PM
@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).
08-25-2014 01:51 AM
Thank you!