Skip to content
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

The Output of savefig() Does Not Use the Layout Dimensions #491

Open
RoyiAvital opened this issue Nov 14, 2024 · 2 comments
Open

The Output of savefig() Does Not Use the Layout Dimensions #491

RoyiAvital opened this issue Nov 14, 2024 · 2 comments

Comments

@RoyiAvital
Copy link

I create a simple graph with where I set the following layout:

oLayout = Layout(title = "Localization by Range Measurements: Scenario", width = 600, height = 600, 
                xaxis_range = [0, tuGridSize[1]], yaxis_range = [0, tuGridSize[2]], xaxis_title = 'x', yaxis_title = 'y',
                hovermode = "closest", margin = attr(l = 50, r = 50, b = 50, t = 50, pad = 0),
                legend = attr(x = 0.025, y = 0.975), shapes = oShp);
hP = Plot([oTr1, oTr2, oTr3, oTr4], oLayout);
display(hP);

When I save the figure, using savefig(hP, "MyFile.png"); the output neither honor the layout aspect ratio nor the pixels dimension.

Yet documentation says:

image

I'd assume it would take the values from layout.

@empet
Copy link

empet commented Nov 14, 2024

@RoyiAvital
Yes, when you save a plot, set always width, height from layout or not, and scale=1. plotly.py saves a fig as an image of size (width, height) set in Layout, but unfortunately, PlotlyJS doesn't do it.

@RoyiAvital
Copy link
Author

So maybe documentation should note that the output dimensions are set by a pre defined values and not by the p provided.
Currently the documentation is ambiguous.

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

2 participants