LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
altenbach

Even Simpler Multiplot XY graphs

Status: New

This idea got triggered by this other idea but this here is a significant variation and deserves it's own entry.

 

There is possibly some need to graph multiple XY plots on the same xy graphs, all sharing the same X values. One problem with the current XY graph implementation is the fact that the x-values need to be duplicated for each plot, unecessarily inflating the data structures.

 

One possible workaround has been suggested here, but I think we can do better!

 

Remember, that in this scenario, all plots have the same number of points, thus the data could fit in a plain 2D array. Why not?

Currently, xy graphs don't accept 2D arrays, so this will not clash. (Of course downconversion will be problematic).

 

I suggest that we should be able to directly wire a plain 2D numeric array to the xy graph terminal. In this case, the first row (or colum as set by a property or other configuration) is taken as X-array, while the remaining rows (or columns, resp.) are Y1, Y2, Y3, etc. arrays.

 

 

(Of course an xy graph should also accept a 1D cluster array where each element is such a 2D array. This is useful if there is more than one set of multiplot data, each with a different x-range or number of points.)

7 Comments
GregSands
Active Participant

I like this much better than the other idea, and better than my alternate suggestion in that idea, for the simple reason that it is easy to extract one of the Y-graphs without messing around transforming clusters!

peos
Member

Are you stealing my ideas? Shame on you! 🙂

 

Yes, I agree that this method is even simpler. It also makes it easy for the LabVIEW developers to let XY Graph take any number of plots. My suggestion will probably need one polymorphic instance for each size of the data cluster.

 

There is one pitfall: The user might easily put the data in rows and plot it from colomns (or vise versa) without any warning, exept that the graph look strange. Maybe X-values should be in a 1D array and Y-values in a 2D array. Then you will get a message if the size of the X array differ from the number of rows (or colomns) in the Y array.

altenbach
Knight of NI

Waveform graphs already have the "transpose?" property. The same could be used to decide if the xy data is in rows or columns.

Manzolli
Active Participant

The idea of having multiple X arrays, one for each Y array is to plot many totally independent graphs. With this simplification LabVIEW should start to undertand a 2D array as a simplified way, described in this idea. If a XY Graph indicator receives an array of clusters, LabVIEW will behave like it does right now, right?

André Manzolli

Mechanical Engineer
Certified LabVIEW Developer - CLD
LabVIEW Champion
Curitiba - PR - Brazil
altenbach
Knight of NI

> LabVIEW will behave like it does right now, right?

 

Yes, all currently allowed data structures (array of clusters of xy-points, cluster of x-array and y-array, complex array, array of cluster of x-array and y-array, array of clusters of complex arrays, etc. ) will work as before.

waynep
Member

XY Plots:

I would like to have multiple Y arrays for each X array also. I run into this case ALL THE TIME and have to save the same X array into each plot.

I would recommend an alternate format of a cluster of a 1D Array (X) and a 2D Array (Y's). That way when you unbundle it, you can gain access to the X array easily. PLEASE ADD THIS!

RavensFan
Knight of NI

WayneP,

 

If you want it, don't just make a comment in the thread.  Be sure to click the Kudo Star at the top of the idea.  That registers your vote.  The number of kudoes is one of the key factors that NI looks at in deciding what Idea Exchange posts to look closer at.