-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Closed
Copy link
Labels
Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Milestone
Description
Create a figure and axis, and add a vspan to that axis. If you twinx it, and apply a plot to the twin, the x_limits can adjust, potentially making the vspan not visible.
Minimal code sample:
fig, ax = plt.subplots(figsize=(12, 10))
ax.axvspan(1,2)
fig.canvas.draw()
bx = ax.twinx()
bx.plot([0,.5], [1,2])
fig.canvas.draw()
Note how the x-axis labels shifted away from the range (1,2).
I expected:

- Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)
Matplotlib 1.5.1 on OS X 10.11 with Python 2.7.10 - System python,
pip install -U matplotlib(with SIP disabled)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

