LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

graphs

So i want to display 2 graphs on the same display. Both of them being y=mx+b. I want to be able to change the m and b in both graphs. so it shows 2 different lines on the diplay.

I was thinking about using an XY graph, and then a loop that calculates maybe 10 points for each line? And then using those to make the lines? Could anyone help me with this, is there a more efficient way? 

 

0 Kudos
Message 1 of 5
(448 Views)

@corned wrote:

So i want to display 2 graphs on the same display.


Your words are a bit ambiguous and I assume you want two plots on the same graph. Right?

 

You only need an xy graph if the x values are not spaced equally and not shared between the two plots.

 

All you need is create a ramp of x values (1D array of DBL), then calculate y1 and y2. To graph a line, it is sufficient to have two endpoints each.

the front pane will have one graph and controls for x range,  slopes and offsets. The diagram should have a toplevel loop with a reasonable wait and the code that calculates the two lines based on the controls. How far did you get?

 


@corned wrote:

Could anyone help me with this, is there a more efficient way? 

You need to define words such as "efficient" that can mean many different things to different people (less code, faster code, less memory use, etc.)

 

Have you done any of the learning resources listed at the top of the forum?

Message 2 of 5
(437 Views)

yeah 2 plots on the same graph but everything i try doesnt work.

 

0 Kudos
Message 3 of 5
(428 Views)

Once you show us what you tried, we can tell you how to fix it.

 

Do you have a front panel with the required controls and indicators in the right representation? Have you decided on an x-range?

How far did you get with the diagram? Did you look at the help?

0 Kudos
Message 4 of 5
(414 Views)

Post your attempt so we can see where you have trouble...

 

Also, Help > Find Examples... Building User Interfaces > Displaying Data > Graphs and Charts  

 

Look at Waveform Chart Data Types and Update Modes.vi and XY Graph Data Types.vi 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 5 of 5
(412 Views)