Weird behavior of matplotlib plt.Rectangle
问题 I was trying to make a " matplotlib cake ". ;) I have the following code: It should print a blue and an red rectangle, divided by a green "coating". import matplotlib.pyplot as plt def save_fig(layer): # Hide the right and top spines ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) # Sacale axis plt.axis('scaled') fig.savefig(layer+'.pdf', dpi=fig.dpi) fig.savefig(layer+'.jpeg', dpi=fig.dpi) gap =10 fig, ax = plt.subplots() rectangle_gap = plt.Rectangle((0-gap, 0),