LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Plot Handles to change plot attributes

Hi,
I am drawing 6 plots on graph control and storing respective plot handles in array. But when I used those plot handles to change some plot attributes its giving error by saying "Invalid Plot Handle" other than for last plot drawn. I just wanted to know is this valid error or I am doing some mistakes in implementation.
 
Thanks
Gajanan
0 Kudos
Message 1 of 6
(3,959 Views)

Supposing you are correctly storing the plot handles in the array and using them on the same graph control, there should be no problem in doing so. Also, check that ATTR_DATA_MODE in the graph control is not set to VAL_DISCARD.

int  plotH[6];

plotH[0] = PlotXY (panelHandle, PANEL_GRAPH, x, y1, 100, VAL_DOUBLE,
       VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE,
       VAL_SOLID, 1, VAL_RED);
plotH[1] = PlotXY (panelHandle, PANEL_GRAPH, x, y2, 100, VAL_DOUBLE,
       VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE,
       VAL_SOLID, 1, VAL_BLUE);
plotH[2] = PlotXY (panelHandle, PANEL_GRAPH, x, y3, 100, VAL_DOUBLE,
       VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE,
       VAL_SOLID, 1, VAL_GREEN);

SetPlotAttribute (panelHandle, PANEL_GRAPH, plotH[0], ATTR_PLOT_STYLE,
      VAL_FAT_LINE);



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 6
(3,957 Views)
Hi Roberto,
 
Thanks, Its working fine. Is there any plot attribute to change the pointFrequency (The point interval at which to draw marker symbols).
 
Gajanan
0 Kudos
Message 3 of 6
(3,945 Views)
Hello Gajanan,

One of the parameters to the PlotXY function (as well as the PlotX, PlotY, PlotWaveform) is pointFrequency:

int PlotXY (int panelHandle, int controlID, void *xArray, void *yArray, int numberOfPoints, int xDataType, int yDataType, int plotStyle, int pointStyle, int lineStyle, int pointFrequency, int color);

integer The point interval at which to draw marker symbols when the curve style is VAL_CONNECTED_POINTS or VAL_SCATTER. The default value is 1 and can be as large as the number of points in the plot.

I believe that this is the only place to change the point frequency for the plot.

Hope this helps, and thanks for posting!

Travis M
NI
Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 4 of 6
(3,933 Views)

Hi Travis,

Thanks,

Actually I am looking for pointfrequency attribute something like "ATTR_PLOT_STYLE".

Anyway thanks once again

Gajanan

0 Kudos
Message 5 of 6
(3,920 Views)

Hello again Gajanan,

I checked around to see if there was an attribute for that, and I did not find anything that seemed to fit that description.  I think the only place to set the point frequency is when you actually call the plot function.  This is somewhat expected since if you were to change that attribute you would probably have to redraw the plot anyhow.

Thanks again for posting, and please let me know if we can help you out any further.

Regards,

Travis
NI

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 6 of 6
(3,908 Views)