Is it possible to control the output figure size including legends and axes?
See original GitHub issueWhen I set figure_size
through theme or the options it seems like this setting only controls the figure itself, but does not take into account legends, axis, titles, etc.
Is there another setting that could set the size of the overall resulting figure?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Creating figure with exact size and no padding (and legend ...
Something I can come up with is the following: It sets the text in figure coordinates and then resizes the axes either in...
Read more >Change Axis Labels, Set Title and Figure Size to Plots with ...
functions to change axis labels and set the title for a plot. We can set the size of the text with size attribute....
Read more >How to change figure size? - MATLAB Answers - MathWorks
The paper size options are for printing, so they don't change the size of the figure. The 'Position' property sets the size of...
Read more >matplotlib - 2D and 3D plotting in Python
Great control of every element in a figure, including figure size and DPI. High-quality output in many formats, including PNG, PDF, SVG, EPS,...
Read more >Advanced plotting — Python4Astronomers 2.0 documentation
defines two figures, one with two sets of axes, and one with one set of axes. ... you can control the font size...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi there, I know this issue is a year old, but @wangmallory and I have been working on an extension to
plotnine
(cowpatch
), and in this package we use an idea suggested in a blog post by Kavi Gupta (@kavigupta) in a backend to create correctly sizedplotnine
objects /matplotlib
figures. The problem (loveplotnine
b.t.w.) is thatplotnine
’s underlying code leveragesbbox_inches=“tight”
frommatplotlib
. I do see that @has2k1 is looking into converting toplt.tight_layout()
(issue #390).A solution using our package would be something like the following:
The resulting file
local_image.pdf
(in whatever format you’d like) should be the desired size (up to someeps
). For the above example, here is a screengrab of the size information from adobe acrobat:Note that this “solution” is an interative one, and sometimes (especially with large legends) this can still fail since the legend may constraint the minimum size your image can actually take.
Thanks @himalayajung, though I don’t think that would help. What I want to accomplish it to set the size of the pdf plotnine would generate in advance, and have all the components fit that space. That makes it easier to them include the figure in a paper and keeping font and figure sizes uniform. I believe this is similar to the matplotlib tight layout feature, though I haven’t used it in a while, so I might be mistaken.