Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
Bug report
Bug summary
Moving ticks and labels to the top and right axis using rcParams or Axes.tick_params() doesn't move the offset text as well.
Code for reproduction
frompylabimport*rcdefaults()rcParams.update({"xtick.top":1,"xtick.labeltop":1,"xtick.bottom":0,"xtick.labelbottom":0,"ytick.right":1,"ytick.labelright":1,"ytick.left":0,"ytick.labelleft":0,})figure().add_subplot().set(xlim=(10001,10002),ylim=(10001,10002))savefig("/tmp/rc.png")rcdefaults()figure().add_subplot().set(xlim=(10001,10002),ylim=(10001,10002))gca().tick_params(top=True,labeltop=True,bottom=False,labelbottom=False,right=True,labelright=True,left=False,labelleft=False)savefig("/tmp/tickparams.png")rcdefaults()figure().add_subplot().set(xlim=(10001,10002),ylim=(10001,10002))gca().xaxis.tick_top()gca().yaxis.tick_right()savefig("/tmp/tick_dir.png")
Actual outcome
Positioning via rcParams:
via Axes.tick_params():
via XAxis.tick_top()/YAxis.tick_right():
Only the latest approach works. (The offset texts are overlapping, but that's another issue...)
Expected outcome
Same as XAxis.tick_top()/YAxis.tick_right()
Matplotlib version
- Operating system: linux
- Matplotlib version (
import matplotlib; print(matplotlib.__version__)
): HEAD - Matplotlib backend (
print(matplotlib.get_backend())
): agg - Python version: 39
- Jupyter version (if applicable):
- Other libraries: