I tend to use the following axes options in my Matplotlib (v1.3.1) plots:
ax.spines["top"].set_visible(False)
ax.spines["bottom"].set_visible(True)
ax.spines["right"].set_visible(False)
ax.spines["left"].set_visible(True)
ax.get_xaxis().tick_bottom()
ax.get_yaxis().tick_left()
ax.tick_params(axis="both", which="both", bottom="off", top="off",
labelbottom="on", left="off", right="off", labelleft="on")
This works fine after grabbing the current axis, but I was wondering whether I could make all this default behaviour by setting things in rcParams
?
As mentioned in ImportanceOfBeingErnest's comment, this is now possible:
plt.rcParams['axes.spines.top'] = False
plt.rcParams['axes.spines.bottom'] = False
plt.rcParams['axes.spines.left'] = False
plt.rcParams['axes.spines.right'] = False
For multiple rcParams
use a dict
:
plt.rcParams.update({'axes.spines.top': False, 'axes.spines.right': False})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With