LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot a vertical line on XY Graph

I am trying to plot a vertical line on a XY Graph containing several unevenly sampled plots. I don't want to use a cursor. Has anyone run into this situation? Is there any way to do it using just one point (X)?
Thanks
0 Kudos
Message 1 of 15
(13,166 Views)
Sure. On the plot that you want to have the vertical line, right click the plot legend and select Bar Plots (pick the style you want) and then Fill Base Line (pick the fill style).
Message 2 of 15
(13,165 Views)
Thanks but I need to have a line from top to bottom
0 Kudos
Message 3 of 15
(13,165 Views)
What Dennis suggested will do the trick for you. Attached is a vi that shows you how to do it programatically.

Tim
Message 4 of 15
(13,166 Views)
That might work, thank you very much
0 Kudos
Message 5 of 15
(13,167 Views)
If I have to plot many vertical lines? What should I have to do?

Thank you in advance.
0 Kudos
Message 6 of 15
(12,913 Views)
Look at the example posted. Multiple lines is multiple xy pairs. For two lines, you have 2 elements in the x array and 2 elements in the y array. For 3 lines, 3 in the x array and 3 in the y array, etc. Try to write some code and if you get stuck, post what you have written and details on what the problem is.
0 Kudos
Message 7 of 15
(12,908 Views)
A few tricks for XY plots:
  1.  Verticle lines can be achieved using (X,minY),(X,MaxY) such as the XY array (0,0),(10,0),(10,10), (20,10),(20,0) with connected plot style will plot a square wave. 
  2.  Switching between plots (multiplot) can allow you to change colors, stlyse in what appears to be a single plot.
  3.  This seems not to work because gaps in numbers will show a connected line.  Fix this with using NaN for you Y value at the point you dont want the plot to show.
  4.  Text on plot.  Use a cursor but make the cursor color transparent.  You can set the cursor to the XY where you want text (cursor caption or lable) to appear without the user knowing that there is a cursor in use.
 
There are so amny ways to use the XY graph, just requires a little imagination.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 15
(12,904 Views)
I tried something, but it didn´t work as I expected.

I attached the file, maybe you can help me to solve my problem.

Thank you in advance.
0 Kudos
Message 9 of 15
(12,894 Views)
You are adding a completely new plot each time you click on the graph and the lines become visible as soon as that's property is set to bar plot. Do you really want to add a new plot or will adding another vertical line to the existing plot be enough? If one want just one plot, turn the interpolation off and append the new x and y points to the original x and y arrays. Don't create another new element in the cluster array.
0 Kudos
Message 10 of 15
(12,885 Views)