axhspan() in empty plots changes the xlimits of plots sharing the X axis #18137
Labels
Difficulty: Medium
https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Good first issue
Open a pull request against these issues if there are no active ones!
status: confirmed bug
Milestone
Bug report
Consider you have a figure with multiple subplots sharing the X axis (
fig.subplots(2, 2, sharex="all")
). When usingaxhspan()
in an Ax without data, the rest of Axes will change the X axis potentially leaving data outside the range.Code for reproduction
Actual outcome
Expected outcome
I expected both Axes to use a shared X axis in the range 1 to 4, because the data covers that interval
Matplotlib version
print(matplotlib.get_backend())
): nbAggInstalled via pip. Running inside a
python3 -m venv
Thank you!
The text was updated successfully, but these errors were encountered: