LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
AlexHann

Maintain aspect ratio on graphs (similar to r 'asp = #')

Status: New

Have a property node function that can set the aspect ratio of the gridlines in a Graph based on the data. Similar to the 'asp = #' function in r

4 Comments
X.
Trusted Enthusiast
Trusted Enthusiast

How would that work? If you want to rescale the graph programmatically, you can by setting the X and Y ranges succesively (not familiar with R, but I suppose this setting is defining the graph to be plotted, and it is not an interactive object).

If you want to zoom/unzoom interactively while keeping the aspect ratio, you can, using the diverging and converging arrows tools. If you use the ROI tool, of course you will lose the aspect ratio.

I am not saying this is not an interesting suggestion. Just trying to clarify the intent (in particular the "based on the data" part).

AlexHann
Member

The aspect ratio function is described under rplot's help and explains how:

 

https://stat.ethz.ch/R-manual/R-devel/library/graphics/html/plot.window.html 

 

It uses the data to set the overall max/min for each axis, but the asp function allows the scaling to be of a defined ratio. if set to 1 it keeps the data "square", which i found useful for comparing trends in XY graphs of differing magnitudes. 

 

I was thinking it would be more useful in the properties for programmatic use

X.
Trusted Enthusiast
Trusted Enthusiast

Your link is internal. And it is better practice to explain as clearly as possible what you have in mind (at the cost of repeating what has been described on other sites, which may go down or be inacessible).

Having such an option for a graph would require having a way to change it back interactively as well (i.e. be able to type an aspect ratio somewhere and check a box to apply or not the constraint). Likelihood this happens? Close to nil. But agreed, it could be a useful option. Kudo.

altenbach
Knight of NI

This has to do with scaling of the axis in relation to the graph area (which is not even fixed unless we disable "autoadjust scales").

 

Long ago I made a list of desired scaling options in this idea comment. What you are requesting seems to be along the same lines.