LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use list of values as X Scale or marker in Graph/Waveform Chart

Solved!
Go to solution

Hey there,

 

I am quite new to LabView and haven't really found I was looking for so far. 

 

In other languages like Matlab you can use a 1D Array of Numbers as X Values e.g. [1.4, 1.55, 1.9, 12].

If you then want to plot your Y Data you can use this array of XValues and assign it to them in the plot like:

plot(XArray, YArray).

 

LabView offers me the Property XScale Minimum, Maximum, Increment which is not what I need because I do not have linearly spaced X Values. From what I found so far I could accomplish what I need by passing my 1D Array of XValues to the XScale Marker Val property, but I haven't quite understood how I can manage to display the xvalues this way to see them in the displayed graph. 

 

Thanks in advance for your help.

 

best,

 

Julian

0 Kudos
Message 1 of 5
(3,846 Views)

Hi Julian,

 

do you need a XYGraph? This one is designed to plot XY data!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,834 Views)

Hi Gerd,

 

lets put it that way: We plot XY data, but on most occasions we have multiple sets of XY data that have to be displayed simultaneously in one plot. To implement that I merged the signals and fed it into a Waveform Chart or a Waveform Graph, what worked nicely.

Using a merged signal it gave me an error using a XY Graph - I did not really understood why it did not work with a merged signal since it is XY data - Maybe you can resolve this or propose the most suitable plot type. 

 

best,

 

Julian

0 Kudos
Message 3 of 5
(3,822 Views)
Solution
Accepted by topic author jschmidtengler

Hi Julian,

 

the help for the XYGraph shows the most recommended datatypes expected by the graph:

 

check.png

- Usually you create one plot as cluster of (X array, Y array).

- When you need more than one plot: create an array of plots!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(3,812 Views)

Hi Gerd,

 

thanks very much for this advice! I made this work using the Build XY Graph function and an XY Graph.

I attached a picture of how I feed a merged signal into the Build XY Graph box. How do I accomplish what the Build XY Graph box makes using normal labview functions? 

 

edit: Just found the XY Graph.vi in the examples! That solves my problem entirely !

 

best,

 

Julian

0 Kudos
Message 5 of 5
(3,807 Views)