matplotlib graph white space

David Lowry-Duda david at lowryduda.com
Mon Oct 4 09:55:52 EDT 2021


> I am using the first bar graph listed at this site:
> https://matplotlib.org/stable/gallery/index.html
> 
> The problem I have is that there is too much white space around the graph.
> My data would be better displayed if I could widen the graph into the space
> to the right and left of the chart.

It sounds like you're asking about changing the size and dimension of a 
graph. Is that right?

Then I suggest looking into `figsize` when creating a figure (especially 
if you are using the object oriented interface). Alternately, you can 
adjust the size of a figure afterwards with `fig.set_size_inches` (and 
variants), and you can get the figure if you are using the matlab-style 
interface with `matplotlib.pyplot.gcf()`.

- DLD


More information about the Python-list mailing list