LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Related to drawing a graph using PlotY( ) ;

I am using LW / CVI in my application . Now I plot a graph using PlotY(); function . I know this function plots points on x -axis i.e  y=0 . Now could anyone tell me how can I plot y values w.r.t  y!=0 i.e on some threshould value parallel to x-axis .
 
Regards
subrata
0 Kudos
Message 1 of 3
(3,072 Views)

PlotY plots ponts in an array against its indeces, i.e. you may imagine that a implicit array exists that contains values 0, 1... n-1 where n=number of elements in y array. PlotY so plots the points (y[0], x[0] = 0), (y[1], x[1] = 1)... (y[n-1], x[n-1] = n-1). That is, this function can print only a value with x=0, precisely the first element in Y array!

To plot points in arbitrary x values (even x=0) you must switch to PlotXY, passing to the function both x- and y-arrays.



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 3
(3,071 Views)


@Roberto Bozzolo wrote:

PlotY plots ponts in an array against its indeces, i.e. you may imagine that a implicit array exists that contains values 0, 1... n-1 where n=number of elements in y array. PlotY so plots the points (y[0], x[0] = 0), (y[1], x[1] = 1)... (y[n-1], x[n-1] = n-1). That is, this function can print only a value with x=0, precisely the first element in Y array!

To plot points in arbitrary x values (even x=0) you must switch to PlotXY, passing to the function both x- and y-arrays.




Of course it was to be intended (x[0] = 0, y[0]), (x[1] = 1, y[1])... (x[n-1] = n-1, y[n-1]). Smiley Wink

And I forgot to mention the possibility to use PlotX instead to plot values against its indeces on the Y axis...

I consider these plot types useful for reresentations where the reference axis is not a measure: for example a single measure on different samples (sample id in x-axis and measures in y-axis with PlotY, possibly with bar plots), or even monthly income or similar diagrams. When two sets of measures are to be represented one against the other, PlotXY is the best way of representing them even if the reference set is apparently regularly spaced like in the case of measures vs. time.



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 3 of 3
(3,055 Views)