# Hide the right and top spines ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False)