LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot same X values on x-axis with multiple Y values on the same graph

Does anyone know to plot an xy graph similar to the attached screen done in Excel? Preferably continuous plotting xy values WITHIN a loop like an updating time chart.
 
Thanks
0 Kudos
Message 1 of 12
(4,495 Views)

napview:

If you already have the x and y arrays, you could feed them into a XY graph and create the chart as seen in your picture. The only thing about it is that unless you build your x and y array continuously. you will not be able to create a continuous chart because xy graphs only take arrays of data. You could also use "Create Histogram" Express VI to create an histogram of your data by specifying the number of bins and other parameters. I hope this helps and please let me know if I misunderstood you.

Regards,

Rudi N.

 

0 Kudos
Message 2 of 12
(4,467 Views)

Rudi,

X array = [0 0 1 1 2 2]

Y array = [5 6 7 8 9 10] where Y = 5, 6 when X = 0 and so forth.

Histogram would not work because bins showed up as columns with multiple Y values.

0 Kudos
Message 3 of 12
(4,455 Views)

napview:

Thank you very much for getting back with me. How are you generating the X array of data?. I would like to know the logic behind the data so that I can implement in LabVIEW. Histograms by nature do not have that type of patterns in the numbers.

Regards,

Rudi N.

0 Kudos
Message 4 of 12
(4,431 Views)

Rudi,

You can open the attached vi 8.2 for the arrays. Thanks for trying to help.

 

0 Kudos
Message 5 of 12
(4,428 Views)

napview:

Thank you very much for providing more information about what you are trying to do. I am very curious about you were able to draw such a plot in Excel. In any case, I found a way to get a similar plot using LabVIEW. Please take a look at the attached VI and let me know what you think.

Regards,

Rudi N.

Download All
0 Kudos
Message 6 of 12
(4,395 Views)

Rudi,

You got it! Thank you very much for your time. Now I need to integrate the example into the codes.Smiley Wink

0 Kudos
Message 7 of 12
(4,390 Views)

napview:

I am pleased to hear that it answered your question. I am just curious to know how this part fits in your overall application. I guess I am asking how relevant is it to have the data plotted in this way?.

Thanks,

Rudi N.

0 Kudos
Message 8 of 12
(4,371 Views)

Rudi,

Actually looking more carefully at your code, the x scale marker is not exactly whatever from the X data array [0 0 1 1 2 2] (in this case) because it is generated by a remainder from a division (harder to do). In the application, the reason is that it is easier than to see the data points spreading out rather than being clustered at the same x marker. 

0 Kudos
Message 9 of 12
(4,361 Views)
napview:
 
You are right in your observation. Most software do not have a native way of doing this, as far as I know. I had to find another way to make it work. Please let me know if you are able to incorporate it into your application.
 
Thanks,
 
Rudi N.
0 Kudos
Message 10 of 12
(4,333 Views)