matplotlib graph white space
tjol at tjol.eu
Wed Oct 6 12:32:43 EDT 2021
On 04/10/2021 10:39, Steve wrote:
> I am using the first bar graph listed at this site:
> 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.
To tweak the amount of padding around the matplotlib axes, you can use
pyplot.subplots_adjust  or Figure.subplots_adjust .
In most cases, the tight_layout function/method [3,4] will give you
sensible settings for the various spacing parameters.
You probably also have to adjust the figure size (see David Lowry-Duda's
reply) to get whatever effect it is that you want.
More information about the Python-list