question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Q: how to have a couple of images with `bbox_inches='tight'`.

See original GitHub issue

More of a question than an issue. Sorry if this is inappropriate place for this - feel free to close if you have a better channel.

In https://matplotlib.org/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py I want to show the effect of both using bbox_inches='tight' and not using it. Is it possible to make sphinx gallery do this?

I’ve tried saving the file to ../../doc/_static/constrained_layout/ but circleCI doesn’t like that, claiming there is no such directory (it works fine on a local build). The simplest solution is to just comment out the save, and put the generated file in static and commit the file that way, but then if constrained layout changes, someone needs to remember to regenerate the static file.

So, is there any way to get the tutorial to generate the file and switch the kwargs for savefig?

Thanks for any pointers…

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
larsonercommented, Aug 31, 2020

Fine with me

1reaction
lucyleeowcommented, Aug 31, 2020

@larsoner (and @jklymak) are you happy for this to be closed? I think the solutions were good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

matplotlib savefig image size with bbox_inches='tight'
You can make the resultant image 1000x1600 pixels by setting the figure to be 5x8 inches fig.set_size_inches(5, 8). and saving with DPI=200 :...
Read more >
Formatting your images for display on the web
Use this guide to understand how images display on the web, learn about Squarespace image requirements, and find formatting tips for your images...
Read more >
Change the size of a picture, shape, text box, or WordArt
Click the Size tab, and under Scale, make sure the Lock aspect ratio check box is clear. Enter percentages you want for Height...
Read more >
How to use basic PowerPoint skills to make pictures fit
Use the handles the same way you use the resizing handles earlier: click, hold, and drag in and out. The picture doesn't change...
Read more >
Save Plot as Image with Matplotlib
In this article, we'll take a look at how to save a plot/graph as an ... If we'd like to set it to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found