LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

costomize output of x axis

Hello All,

I have a 2D array of data  { [r,g,b,z], [6,2,9,1] }.

I would like to draw an X-Y graph where the X axis will show  [r,g,b,z]    and the corresponding values in the Y axis is [6,2,9,1].

The problem is that the XY graph now seems to restrict the X axis to consequtive numbers 1,2,3,4,5,6, etc

May I know if there is anyway to the the X axis to accept an array and display the array in the correct sequence following the array.

Thanks,
B12060

** Please don't tell me to create a list of strings and place it at the x axis area. The graph values are dynamic and change frequently so while this is possible it would require alot of programming to change the text and spacing of the indivitual strings correctly **
0 Kudos
Message 1 of 9
(3,843 Views)

Hi B12060,

i see no problem to do what you want. See the attachment please. The only think you have to do is to get the arrays out ouf your 2D Array.
I hope it helps.

Mike

0 Kudos
Message 2 of 9
(3,836 Views)
That doesn't really answer the question, which is actually how to get the X Scale to display text labels. The user is saying that they have a 2D array, but I think that's on paper only. They want the X Scale to display text labels such as "r, g, b, z".

See this thread.
0 Kudos
Message 3 of 9
(3,816 Views)

Hi smercurio,

thanks for clarification.

Mike

0 Kudos
Message 4 of 9
(3,812 Views)
Hi B1260,

what about this example?

You didn't show an example of what you really want! Do those x-values are just growing, but not evenly spaced numbers? Or any other kind of numbering?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(3,810 Views)
Thanks GerdW,

Your example allows user to have control on the display of the x-axis.
However, it still rearranges the number so that 1,2,5,10 will always be arranged from smallest value to largest (even if you enter the array as  5,2,1,10)
Also it doesnt allow for strings to be the marker values.

About the graph values. Sometimes user enters 128 values, sometimes 256, or 1024  etc. So the graph markers will change dependiing on how much data user enters.

Does Labview have a graph type that plots the data according to the Y values entered but doesnt rearrange plots with regard to the values of X (instead plots according to the arrangement of the X array)?

Anyway, thanks again.

regards,
B12060

0 Kudos
Message 6 of 9
(3,784 Views)
Hi B12060,

XY-graphs always use an ordered x-axis - no way to leave x-values in arbitrary order.

Possible solution: use a simple waveform graph/chart and make your own x-axis using a string indicator... Something you already mentioned in your first question Smiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(3,773 Views)
You can always use a picture control.
Message 8 of 9
(3,759 Views)

Hello smercurio_fc,

This would work Smiley Happy !!

Thanks,

B12060

 

0 Kudos
Message 9 of 9
(3,736 Views)