LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiplot

Solved!
Go to solution

Hello!

I am working on a project on how to simulate the pressure distribution in pipe. And since the pipe has an elbow, I have to take into consideration the pressure loss in that elbow.

I have been able to plot XY  graphes separately for the straight pipe and for the elbow. 

But I am not able to combine both together so that the Presssure in the straight Pipe be the first and at its end be the Pressure in the Elbow.

I would be glad if someone can help.

 

Here, I have attached the file along with the input datas.

 

Thank you in advance.

Download All
0 Kudos
Message 1 of 7
(2,789 Views)
Solution
Accepted by topic author Nshuti88

You should be able to put them both on one X-Y graph by building an array out of the two clusters you made.

 

Some additional advice to improve the user interface would be to add units to the inputs, Initial Pressure might become Initial Pressure (ksi).  This way, the user knows that the units of pressure are in ksi and not MPa.  You can also right click your controls and select Data Operations > Make Current Value Default so you don't have to show a picture of the values you used.  This can be helpful if there are values that the user will almost always use (Step size for instance)

Matt J | National Instruments | CLA
Message 2 of 7
(2,760 Views)
Solution
Accepted by topic author Nshuti88

Jacobson is correct, you can build an array of your clusters in order to plot them both on the same plot.

 

However, it sounds like you want to place them end-to-end in that plot.

In this case, you would have to adjust the independent values of your elbow data accordingly (i.e. add the endpoint of your straight section to all values).

 

One solution is to have a single "plot" on the graph (so one line, with one color, one set of properties, etc.) that contains both your straight and your elbow data concatenated.  Concatenate the arrays prior to building your cluster, then send that to the plot.

 

A second solution is to have two "plots" on the graph (for instance, by default one white line and one red line) that are aligned so that the second one begins where the first one ends.  This is the same as what Jacobson said - build an array of your clusters and then send that to the plot - just done after adjusting the independent values of your elbow data.

 

Also, you can read the help for XY Graphs:

 

Displaying Multiple Plots on XY Graphs

The XY graph accepts three data types for displaying multiple plots. The XY graph accepts an array of plots, where a plot is a cluster that contains an x array and a y array.

The XY graph also accepts an array of clusters of plots, where a plot is an array of points. A point is a cluster that contains an x value and a y value. The XY graph also accepts an array of clusters of plots, where a plot is an array of complex data, in which the real part is plotted on the x-axis and the imaginary part is plotted on the y-axis.



Message 3 of 7
(2,753 Views)

Hello!

It's me again.

I've been trying to do it as you told me, but it doesn't work out.

I want that both lines connect end-to-end.

When I run it, both are starting from the origin.

Here, I attached my VI so far.

Can you help me again, please.

0 Kudos
Message 4 of 7
(2,727 Views)
Solution
Accepted by topic author Nshuti88

@VItan wrote:

...

However, it sounds like you want to place them end-to-end in that plot.

In this case, you would have to adjust the independent values of your elbow data accordingly (i.e. add the endpoint of your straight section to all values).

...


 



Message 5 of 7
(2,714 Views)

Yeah!

That's what I wanted and finally I made it.

You were really helpful to me and I appreciate so much.

Thank you again

0 Kudos
Message 6 of 7
(2,705 Views)

Nshuti,

 

Can you post your final VI?  Posting the result may help someone in the future who is having the same issue.

Matt J | National Instruments | CLA
0 Kudos
Message 7 of 7
(2,674 Views)