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

When I saved graph in JPG format it's outer axis are no longer present. #10749

Closed
tannu2811 opened this issue Mar 11, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@tannu2811
Copy link

commented Mar 11, 2018

#Code
1
#After saving when I opened the img
2
#Adding fig.tight_layout() results in err
3

@ImportanceOfBeingErnest

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2018

This is not a bug, and the result is expected.

First, add_axes([0,0,1,1]) creates an axes which is exactly as large as the figure. Therefore it is expected that the labels are outside of the figure.

Second, tight_layout can only be used on figures which include subplots. From the documentation:

tight_layout automatically adjusts subplot params so that the subplot(s) fits in to the figure area.

If you want to use tight_layout, use subplots instead of simple axes. If you have a problem of implementing, consider refering to existing questions on stackoverflow or consider asking a question there.

@WeatherGod

This comment has been minimized.

Copy link
Member

commented Mar 11, 2018

@jklymak

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2018

fig.savefig('name.png', bbox_inches='tight')

@jklymak jklymak closed this Mar 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.