Skip to content

Axis equal option #1384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
geocosmite opened this issue Feb 15, 2017 · 2 comments
Closed

Axis equal option #1384

geocosmite opened this issue Feb 15, 2017 · 2 comments

Comments

@geocosmite
Copy link

geocosmite commented Feb 15, 2017

In some situations it is important that the distance for a given range in data is identical along the x and y axes (or z for 3D plots). In Matlab it is possible to use the "axis equal" constraint in such cases but I haven't yet been able to find equivalent functionality in Plotly.

I have been successful at getting the correct aspect ratio for the axes and ranges for the case depicted below left where (1) the plot width and height are identical, (2) the x-axis and y-axis ranges are identical, and (3) the plot legend is wholly within the axis boundaries. (The two magenta "measuring sticks" on the outer axis bounds have identical lengths in the plot.) An example of where I have failed, however, is the case below right where the plot is configured identically except that the legend now is to the right of the x-axis upper bound. Here what I would like to have happen is that the y-axis of the plot would shrink such that its upper bound (35) would move down to the position of the horizontal magenta line. In this way the data / axis aspect ratio would be identical to that of the x-axis. I know that this effect could be accomplished by reducing the plot height but I see no a priori way to know what value to use to preserve the data / aspect ratio given that I have no information on the width of the legend.

image

An additional example of where the axis equal option would be invaluable is where the 'heatmap' and 'contour' plot types are used to show map data that are plotted in UTM coordinates as illustrated below. In this case it is difficult to ensure that the x-axis and y-axis / data aspect ratios are identical due to the presence of the color bar.

image

@rreusser
Copy link
Contributor

rreusser commented Feb 15, 2017

Are you referring to setting an aspect ratio? If so, there's a bit of discussion on how this could potentially be implemented at: #272

@etpinard
Copy link
Contributor

merging with #272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants