boxoff#
- boxoff(ax=None, which=None, removeticks=True)[source]#
Removes the top and right borders (“spines”) of a plot.
Also optionally removes the tick marks, and flips the remaining ones outside. Can be used as an alias to
plt.axis('off')ifwhich='all'.- Parameters:
ax (Axes) – the axes to remove the spines from (if None, use current)
which (str/list) – a list or comma-separated string of spines: ‘top’, ‘bottom’, ‘left’, ‘right’, or ‘all’ (default top & right)
removeticks (bool) – whether to also remove the ticks from these spines
flipticks (bool) – whether to flip remaining ticks out
Examples:
plt.figure() plt.plot([2,5,3]) sc.boxoff() fig, ax = plt.subplots() plt.plot([1,4,1,4]) sc.boxoff(ax=ax, which='all') fig = plt.figure() plt.scatter(np.arange(100), np.random.rand(100)) sc.boxoff('top, bottom')
New in version 1.3.3: ability to turn off multiple spines; removed “flipticks” arguments