LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

remove origin plot in graph

Solved!
Go to solution

Hey

 

I am graphing a set of x and y values with the connected points style line. On the graph the data is plotted but there is also a line that goes back to (0,0). Is there anyway to have CVI graph just my values and not connected back to the origin? Thanks!

0 Kudos
Message 1 of 3
(4,199 Views)
Solution
Accepted by topic author ACowans

CVI does not connect the last point of a series of measures with the origin. When this happens usually it means that you have stored your measures in larger arrays than you actually need and you are plotting more points than you have acquired, so that extra points with coordinates (0,0) are plotted.

 

As an example, supposing you have those arrays:

double X[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 0.0, 0.0, 0.0, 0.0 }

double Y[] = {1.0, 2.0, 3.0, 4.0, 5.0, 5.0, 5.0, 0.0, 0.0, 0.0, 0.0 }

If you plot only 7 measures you will have a regular plot, if you plot 8 to 11 measures you will see the additional line back to the origin.

 

I suggest you to place a breakpoint immediately before you PlotXY instruction and examine your data arrays with respect to the number of samples to plot.



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?
Message 2 of 3
(4,188 Views)
Thanks Roberto. You are correct. I did not have any values in the first entry in my arrays so that's what caused it to connect the plot to zero. I have fixed it now. Thanks again.
0 Kudos
Message 3 of 3
(4,171 Views)