LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY graph display uncertain number lines.

You can feed an XY Graph two different ways.

 

Option one:

  1. Bundle each X,Y pair into a cluster (one point)
  2. Build an array of points (one plot)
  3. Bundle each plot into a cluster by itself
  4. Build an array of these clusterized plots

Option two:

  1. For each plot make two identically-sized arrays, one of X values and one of the corresponding Y values
  2. Bundle those two arrays into a cluster (one plot)
  3. Bundle each plot into a cluster by itself
  4. Build an array of these clusterized plots

If you need more help with this, share your code so we can see where you're having trouble.

0 Kudos
Message 11 of 21
(1,971 Views)

If the "X" values are time then you can use a Waveform data type such that the "T0" values are the time.

 

There is also a variation on this that comes with the sound a vibration stuff that uses the frequency as if it is T0.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 12 of 21
(1,968 Views)

Oops, I just realized you can omit step 3 of Option 2, the cluster of X and Y arrays can be built directly into an array and doesn't need to be put into another cluster by itself.

0 Kudos
Message 13 of 21
(1,964 Views)

@M.Mei wrote:

The x value is from the instrument and the number of plots is not fixed. I got an array(the dimension is typed by users ) as output from an instrument, now I want to display these lines (the first dimension is the x value, and y values respond the remaining dimension). I am very sorry I still do not know how to begin this vi, so I cannot upload a sample...


OK, so you have a 1D array of x values of size N and a 2D array of Y data with N columns and M rows (or vice versa. M=number of plots, which is variable).

 

So all you need is the following (If the Y values are arranged as rows instead of columns, omit the transpose, so modify as needed):

 

MultiXY.png

Message 14 of 21
(1,959 Views)

Thanks altenbach! My input is a bit different from your example. Your vi makes me think about this sub-vi. By this vi, it only can display and save one line at one time. Can you please help me how to revise this vi to display and save multi lines once? The 'array in' is my input, the 'array out' is the output linked the xy graph, and the number is typed by users and it is the reason why I say 'uncertain'.

front panel.JPGback panel.JPG

0 Kudos
Message 15 of 21
(1,951 Views)

Thanks arteitle! But I think my problem is I even do not know how to separate the input... I am a bit confused with the data transmission. I post a sub-vi, and if possible, can you please help me on that?

0 Kudos
Message 16 of 21
(1,947 Views)