07-19-2022 06:39 PM
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
07-19-2022 08:24 PM
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!
07-19-2022 09:50 PM
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.
07-20-2022 01:08 PM - edited 07-20-2022 01:09 PM
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.).
07-20-2022 02:18 PM
I will post my code shorty.
Thanks
07-20-2022 03:20 PM - edited 07-20-2022 03:24 PM
@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!
07-20-2022 03:34 PM
@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! 🙂
07-20-2022 04:12 PM
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!
07-20-2022 06:19 PM
I think I managed to solve it.
See attached.
Thanks
07-20-2022 08:13 PM - edited 07-20-2022 08:14 PM
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.
(Also note that your overuse of "insert into array" seems convoluted. all you need again is built array in concatenate mode.)