10-14-2010 08:01 AM
Hi,
I am using a xy graph with a varying number of plots: a few line plots and several xy plots.
After plotting I would like to inspect the data: For this purpose I thought to cycle through the plots using ATTR_FIRST_PLOT and ATTR_NEXT_PLOT.
Then using GetPlotAttribute ( ATTR_PLOT_YDATA ) I thought to obtain the data sets for analysis - provided that the plot is a xy plot and not a line plot... Unfortunately I did not find a suitable attribute that I could read to distinguish between a line plot and a xy plot - using GetPlotAttribute ( ATTR_PLOT_YDATA ) on a line plot is invalid and will return an error. (There is no plot attribute plot type)
The only trick I could think of is using different line types for plotting - but in this case the xy plots are scatter plots ...
Hints are welcome...
Solved! Go to Solution.
10-14-2010 09:17 AM - edited 10-14-2010 09:18 AM
Well, it seems you are right: there seems to be no attribute to retrieve the plot type!
What I can think of as a workaround is either of the following options:
10-14-2010 09:39 AM - edited 10-14-2010 09:42 AM
[EDITED NOTE: Roberto beat me to it again. I didn't see his response before I posted mine, but here's my response anyway.]
Wolfgang:
I'm surprised that there is no attribute for plot type, but I couldn't find one either in GetCtrlAttribute or GetPlotAttribute. The plot type seems like a pretty basic and important thing to know. You can GetPlotAttribute on the ATTR_PLOT_STYLE, but the style is not the same as the type.
If you want to just try reading the YDATA for all plots and skip any plots that generate errors, you can use SetBreakOnLibraryErrors (0);
I generally don't like disabling all library error dialogs, so I'll use SetBreakOnLibraryErrors just for the code I know I'll handle the errors on. And to be the most flexible, I'll save the current break state when disabling it, so I can restore the previous state later.
For example:
int prevBreak;
//....
// disable library error dialogs, saving the previous break state
prevBreak =SetBreakOnLibraryErrors (0);
// code for which I want to handle or ignore library errors
// ...
// restore the previous break state
SetBreakOnLibraryErrors (prevBreak);
10-14-2010 11:41 AM
There is an undocumented plot type attribute, which you can use. You can't set it, but you can get it.
You can find it in this list of undocumented attributes. In this case, you don't have to worry about the disclaimers I made in that post. After having made that list public, we're certainly not going to deprecate any of them in a future version, and this particular attribute is as straightforward as they come, so you also don't have to worry about it being buggy.
Sorry for the trouble.
Luis
10-14-2010 12:14 PM
Hi Luis,
thanks a lot, that's great news! What about making this attribute public in the next release?
Roberto, Al, thanks for your toughts and suggestions!
10-14-2010 02:20 PM
Okay, we'll add it in a future release, although it probably won't be in the very next one.
Luis