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

savefig truncates figure elements #638

Open
ensatina opened this issue May 10, 2023 · 2 comments · May be fixed by #650
Open

savefig truncates figure elements #638

ensatina opened this issue May 10, 2023 · 2 comments · May be fixed by #650

Comments

@ensatina
Copy link

In the examples for using the savefig() function on page 9 [Please](http://swcarpentry.github.io/python-novice-gapminder/09-plotting.html), the exported figures truncate axis labels.

Is there an easy (appropriate level) modification that could be added so the full figures export? I'm new to Python and this immediately sent me away from the lesson to troubleshoot, so I think it would be good if the code in the lesson exported full figures.

I ended up adding the argument

bbox_inches = "tight"

but I don't know what it means or if there is a better way to do this.

@martinosorb
Copy link
Contributor

Hi @ensatina, indeed what you did there is correct. Matplotlib unfortunately has default options that are not always great.

Are you suggesting we add that argument to the lesson? Personally I would rather keep it simple to avoid lengthy explanations in the course of the workshops. As your own case suggests, it is possible to debug that problem with a bit of googling in case it arises for a learner after the workshop. What do you think?

@vahtras
Copy link
Contributor

vahtras commented May 24, 2023 via email

@Simon-Stone Simon-Stone linked a pull request Jun 6, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants