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
tarungupta9 opened this issue Mar 11, 2018 · 3 comments
Closed

Comments

@tarungupta9
Copy link

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

@ImportanceOfBeingErnest
Copy link
Member

ImportanceOfBeingErnest 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
Copy link
Member

WeatherGod commented Mar 11, 2018 via email

@jklymak
Copy link
Member

jklymak commented Mar 11, 2018

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

@jklymak jklymak closed this as completed Mar 11, 2018
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

4 participants