LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Aligning Y-axes of two graphs when scales are changed

Solved!
Go to solution

This is simplified version of my problem:

  • FP is divided by a splitter
  • Each pane has single control: a XY Graph
  • Each XY Graph fits to its pane
  • Y-scale: autoscale is on

The image illustrates the problem

AlignPlots2.png

 

  • Initial state: both Y-axes are aligned (left in the image)
  • If scale values occupy same width, the axes are still aligned (center)
  • If scale values occupy different width, the axes are misaligned (right)

 

Please advise how I can keep Y-axes aligned when scales are programmatically changed.

I attach the test VI for convenience.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 1 of 8
(1,884 Views)

AFAIK, the Y axis width will always resize depending on the width of the marker texts.

You may use a fairly constant-size numerical format, for example:

pincpanter_0-1619443440198.png

It's rather ugly, though.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 8
(1,852 Views)
Solution
Accepted by topic author _Y_

Right-click on each graph and select Advanced, and then uncheck Auto Adjust  Scales.

This will stop the Y-scale position from moving when the scale range changes.

 

MIG_0-1619470032846.png

 

Message 3 of 8
(1,824 Views)

@MIG  ha scritto:

Right-click on each graph and select Advanced, and then uncheck Auto Adjust  Scales.

This will stop the Y-scale position from moving when the scale range changes.

 

MIG_0-1619470032846.png

 


It's always time to learn something new. I just overlooked this option. I rather expected it as a property for each scale, instead of a global option.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 8
(1,796 Views)

@MIG wrote:

Right-click on each graph and select Advanced, and then uncheck Auto Adjust  Scales.

 


Thank you. It works but one small thing is still annoying. Axes stay in their place now but position of axis titles are changed dependently on width of numeric values. I can solve it selecting a monospaced font (f. ex. Courier) and setting minimum field width:

AlignPlotsSettings210427.gif

 

However, for proportional fonts this setting improves the situation only partially.

 

Is there any way to lock scale titles to their initial positions?

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 5 of 8
(1,791 Views)

Maybe your expectations are too high...

I guess that whatever setting you can apply, LabVIEW would never allow the scale markers to overlap with the title. You cannot guarantee this for an arbitrary marker length. So, let enough space between the title and the scale markers.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 6 of 8
(1,768 Views)

Why not use the mixed signal graph? 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 7 of 8
(1,763 Views)

@Henrik_Volkers wrote:

Why not use the mixed signal graph? 


Thank you Henrik,

 

The reason is simple. The question comes from support of an existing project.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 8 of 8
(1,726 Views)