From 11:00 PM CDT Friday, August 9 - 11:00 AM CDT Saturday, August 10, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

# LabVIEW

cancel
Showing results for
Did you mean:

## Adding vertical lines at x= ?

Hello everyone.
I am using labview 8.6 and i have a small problem:

I need to add two vertical lines at x = ?

x1 and x2 will be controlled by numeric control. So i can be able to move the lines left and right ( both of them).

The problem is i already have xy graph with 2 functions going in.

Message 1 of 9
(2,846 Views)

## Re: Adding vertical lines at x= ?

Add an additional plot for each vertical line you want to draw. This plot is composed of exactly two points: (x, ymax) and (x, ymin). I have found that drawing vertical lines using plots is more flexible and has much better performance than Cursors or Annotations.

Message 2 of 9
(2,831 Views)

## Re: Adding vertical lines at x= ?

Could you show me an example ? Because i dont really understand how to do it.

Thank you for quick response

Message 3 of 9
(2,821 Views)

## Re: Adding vertical lines at x= ?

Before we go further: what's your goal for these two vertical lines? Cursors may be a better fit for your app - do you know how to show two cursors?

Message 4 of 9
(2,819 Views)

## Re: Adding vertical lines at x= ?

I have two functions on this graph:

Y=x^2+5x

Z=3-x^2

I am finding area under the curve of each function and then subtracting them. Part of the lab is to set bounding limits x1 and x2. My VI already does all the calculations but i want to visually show the bounding limit and thats where those two lines come in.

I am not sure if i explained it well. Basically those lines are equal to x=x1, x=x2 they are for the user to see where the bounding limit is.

Message 5 of 9
(2,812 Views)

## Re: Adding vertical lines at x= ?

In that case, there's a more clever way to visually display area under curves: introduce a new curve that traces exactly one of the two existing curves over the x bounds you want, and have it fill up/down to the other curve. Since this is part of an academic lab, it will be a good exercise to scour the forums and find the method to accomplish this. Good luck!

Message 6 of 9
(2,805 Views)

## Re: Adding vertical lines at x= ?

I understand there is easier way but this lab is based on numerical integration with Riemann sums(left,midpoint,right).

Everything is working fine i just want to add x=x1 and x=x2 lines to the graph.

Any ideas?

Message 7 of 9
(2,803 Views)

## Re: Adding vertical lines at x= ?

I understand there is easier way but this lab is based on numerical integration with Riemann sums(left,midpoint,right).

Everything is working fine i just want to add x=x1 and x=x2 lines to the graph.

Any ideas?

Message 8 of 9
(2,803 Views)

## Re: Adding vertical lines at x= ?

I tend to use cursors for that.

Note: In the example you can move the lines to set the x values.

Message 9 of 9
(2,779 Views)