LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Overlaying two XY Graphs into a single XY Graph

Greetings,

 

I have two XY Graphs (Graph A & B) each containing 7 plots and I would like to create a third XY Graph (Graph C) which would be the combination of the first two Graphs and would contain a total of 14 plots (see image attached).

Sounds basic but haven't had much luck so far.

 

Thanks

 

Overlay.png

 

 

0 Kudos
Message 1 of 10
(1,763 Views)

Hi AJ3D,

 

Have you referred to the XY Multi Plot.vi in the LabVIEW example?

 

Also, maybe you can also try to refer to the previous discussion links below for possible solutions

1. Solved: how to plot two xy graph in one xy graph - NI Community

2. Solved: Building multiple plots on a single XY graph - NI Community

 

Have a nice day!

 

 

0 Kudos
Message 2 of 10
(1,739 Views)

Multiplot XY graphs take a large variety of datatypes and the solution strongly depend on your approach.

We can give precise suggestions once you show us your code instead of front panel pictures.

0 Kudos
Message 3 of 10
(1,717 Views)

Let me clarify a bit.

I was able to combine the 2 XY charts into a single one but that also resulted into combining the 2 sets of 7 plots into a single set of 7 plots. Instead I am trying to produce 14 plots out of the 2 x 7 plots on a single graph so I can control their appearance of each plot individually (color, line width, etc.).

 

 

0 Kudos
Message 4 of 10
(1,687 Views)

I will post my code shorty.

 

Thanks

 

0 Kudos
Message 5 of 10
(1,677 Views)

@AJ3D wrote:

I will post my code shorty.

 


Yes, please do. For example, a  "plot" on an xy graph can be a 1D complex array, a cluster x and y arrays, or an array of points (where a point is a cluster of xy pairs). A multiplot need to ensure that all plots are of the same datatype and in addition you might need to tweak the data structures, e.g. a multiplot of complex array needs to be built into a cluster array to ensure that the number of points can differ between plots.

 

For typical structures, "Build array" (concatenate mode!!!!) will probably do what you need to do.

 

Now if you are using the "build xy graph express VI" (almost never needed!!), You get an array of clusters where each cluster contains the x and y arrays for one plot.

 


@AJ3D wrote:

I was able to combine the 2 XY charts into a single one but that also resulted into combining the 2 sets of 7 plots into a single set of 7 plots. Instead I am trying to produce 14 plots out of the 2 x 7 plots on a single graph so I can control their appearance of each plot individually (color, line width, etc.).


The word "chart" has a very special meaning, so please don't use it here to avoid confusion! A chart typical takes scalar values and maintains a limited history buffer. Something completely different!

 

0 Kudos
Message 6 of 10
(1,669 Views)

@altenbach wrote:


@AJ3D wrote:

I was able to combine the 2 XY charts into a single one but that also resulted into combining the 2 sets of 7 plots into a single set of 7 plots. Instead I am trying to produce 14 plots out of the 2 x 7 plots on a single graph so I can control their appearance of each plot individually (color, line width, etc.).


The word "chart" has a very special meaning, so please don't use it here to avoid confusion! A chart typical takes scalar values and maintains a limited history buffer. Something completely different!

 


Sorry, I meant to type Graph not Chart! 🙂

0 Kudos
Message 7 of 10
(1,661 Views)

 

Ok here's my code.

 

Graphs A and B each contain 7 plots each and are built in 2 halves (not really relevant here).
I would like Graph C to be the union of Graphs A and B but containing in 14 plots rather than 7 (as implemented here) so I can have 14 unique plot attributes (color, line width, etc.)

 

Thanks in advance!

0 Kudos
Message 8 of 10
(1,655 Views)

I think I managed to solve it.

See attached.

Thanks

 

0 Kudos
Message 9 of 10
(1,642 Views)

If you have graphs A and B (7 plots each), all you need is "built array" (in concatenate mode. Right-click to change the mode) to create graph C, containing 14 plots.

 

altenbach_0-1658365911903.png

 

(Also note that your overuse of "insert into array" seems convoluted. all you need again is built array in concatenate mode.)

 

0 Kudos
Message 10 of 10
(1,632 Views)