LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change x-axis values from decreasing to increasing in number in XY Graph

Solved!
Go to solution

Hello,

 

I hope you are doing well.

I am working on developing horizontal resistance/strain test rig and so I want to plot Resistance vs Length graph in XY Graph. But every time my graph is starting from highest to lowest x-axis values like if I set 5mm length to start from, then it goes as from 5 to 0. I have tried to add negative function in sketching and also set to invert x-axis from properties of XY graph, but I am not getting desired output; I want to see my plot should start from 0 to highest one value.

For you information, I am using remaining steps output from StepperToGo.vi (LabView Interfacing with Arduino) block for x-axis. I know its output values are decreasing so causing my plot starting from highest to lowest.

 

Kindly suggest.

0 Kudos
Message 1 of 5
(2,163 Views)
Solution
Accepted by topic author Afzal6khan

Hi Afza,

 


@Afzal6khan wrote:

I want to plot Resistance vs Length graph in XY Graph. … I want to see my plot should start from 0 to highest one value.

For you information, I am using remaining steps output from StepperToGo.vi (LabView Interfacing with Arduino) block for x-axis. I know its output values are decreasing so causing my plot starting from highest to lowest.


So you know your X values start with a larger value and decrease to the end of the measurement. And you wonder why the XY graph starts to plot at larger X values and finishes with smaller X values!?

 

Why don't you scale your X values, like this:

x_scaled := x_max - x_remaining

Seems rather trivial…

Best regards,
GerdW


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

@Afzal6khan wrote:

I am working on developing horizontal resistance/strain test rig and so I want to plot Resistance vs Length graph in XY Graph. But every time my graph is starting from highest to lowest x-axis values like if I set 5mm length to start from, then it goes as from 5 to 0. I have tried to add negative function in sketching and also set to invert x-axis from properties of XY graph, but I am not getting desired output; I want to see my plot should start from 0 to highest one value..


Sorry, I don't quite understand your questions. Maybe you could add a picture showing what you gets vs what you want.

 

 

If you want the x-axis inverted (i.e. highest value on the left) just set it in the properties:

 

altenbach_0-1649773911103.png

 

 

0 Kudos
Message 3 of 5
(2,123 Views)

Am I correct that you are plotting an XY Graph, whose inputs consist of an Array of Clusters of 2 elements, X and Y?  And the Graph plots from highest value of X to lowest?  Have you looked at the Array?  Is the first value the highest, and the last value the lowest?

 

If so, what operation (on the data, the Array of Clusters) do you think you need to perform to get the first value the lowest?  Do you know how to program this operation?  Where would you look (in the Block Diagram Palette) for such an operation?

 

Bob Schor

0 Kudos
Message 4 of 5
(2,113 Views)

Oh man! Thank you. I just needed to focus on that basic logical maths. I have sorted out.

0 Kudos
Message 5 of 5
(2,104 Views)