I'm struggling to deal with my plot margins in matplotlib. I've used the code below to produce my chart:
plt.imshow(g)
c = plt.colorbar()
c.set_label("Number of Slabs")
plt.savefig("OutputToUse.png")
However, I get an output figure with lots of white space on either side of the plot. I've searched google and read the matplotlib documentation, but I can't seem to find how to reduce this.
extent
of theimshow
figure, or the amount of border whitespace in the resultant png, around the figure, generated bysavefig
? - unutbusavefig
- so that is what I'd like to sort. - robintw