-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Legend overlaps shaded area in fill_between with legend location "best" #27414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I would like to take on this issue |
The problem seems to be in the _auto_legend_data function in legend.py. fill_between does not add anything that is considered in the calculation of "badness" |
FWIW, if you dig into this, there is also #23323 which appears to have a similar root cause. (Solving one of them is clearly enough to get a PR accepted, but it may be that one can quite easily solve both in one go.) |
Okay, so the result of Perhaps it could be treated as |
Bug summary
When using the
fill_between
function in matplotlib with a legend and specifying the legend location as "best", the legend is not taking into account the shaded area and may overlap with it.Code for reproduction
Actual outcome
Expected outcome
Additional information
No response
Operating system
Windows 11
Matplotlib Version
3.8.0
Matplotlib Backend
module://backend_interagg
Python version
Python 3.11.5
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: