In reference to this post: Removing white space around a saved image
I tried the suggestions on removing white space from my pie chart, but I still can't get rid of the space on the left and right, only top and bottom. When I change "ax.axis('equal')" to "off", it doesn't work, but leaves me with white space on all sides.
import matplotlib.pyplot as plt
labels = ['Fashion', 'Theatre Literature Arts', 'Manners and Customs', 'Image of Women', 'Love', 'Idea of Man', 'Politics', 'Reason', 'Family', 'Education and Formation', 'Structure of Society', 'Image of Men']
sizes = [31, 24, 16, 14, 12, 9, 3, 2, 2, 2, 2, 2]
colors = ['#33691E', '#9768D1', '#BDC6FF', '#FC7D49', '#CD0402', '#BEDB39', '#FFF176', '#FA5B0F', '#FE4D98', '#4A148C', '#8C8C8C', '#A5FFD2']
fig, ax = plt.subplots(constrained_layout=True)
ax.pie(sizes, autopct=None, colors=colors, shadow=False, startangle=90)
plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0, hspace = 0, wspace = 0)
for ax in fig.axes:
ax.axis('equal')
ax.margins(0,0)
ax.xaxis.set_major_locator(plt.NullLocator())
ax.yaxis.set_major_locator(plt.NullLocator())
fig.tight_layout()
fig.savefig('.../Donna-galante1.png', transparent = True, pad_inches = 0, bbox_inches='tight', dpi=1200)
Does anyone know where the problem might be? I'm using jupyter notebook.