LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to draw a line connecting two points on XY graph

Hi,

 

I have three data points plotted on a XY graph from three separate arrays.  I am trying to draw a line to connect two points: 1) reference point (0,0) and 2) random number (0,Y).

 

When I use draw.line, the start point is from the top left corner or starts in the middle and moves to the left side.

 

On the screen shot .jpeg, I want to connect the yellow and red points.

 

Any help would be great.

 

Thanks 🙂

0 Kudos
Message 1 of 4
(7,884 Views)

here's the attachments

Download All
0 Kudos
Message 2 of 4
(7,883 Views)

For the graph properties, look at the plots tab.  If you look at plot 2, you have a line type that does not directly go from point 1 to point 2.

 

Plot 3 does have the direct line type.

 

(Plots 0 and 1 have no line connecting points.)

0 Kudos
Message 3 of 4
(7,862 Views)

@Awalk wrote:

When I use draw.line, the start point is from the top left corner or starts in the middle and moves to the left side.


Start with a "move pen" then use a "draw line".


@Awalk wrote:

On the screen shot .jpeg, I want to connect the yellow and red points.


You don't need the "plot images" overlay for this. Simply add a second point to the plots as needed and set a plot style with interpolation.

See attached quick draft, LabVIEW 9. You can change the line color if desired.

 

(Your entire VI is way too big and can be simplified dramatically. Use a state machine architecture and subVIs. Also learn about mechanical action settings. For example "save data" and "clear data" should be latch action, eliminating the sequnece structure and property node in their frame 2.. etc. etc.)

0 Kudos
Message 4 of 4
(7,854 Views)