Add finer-grain control to Axes.ignore_existing_data_limits#18771
Add finer-grain control to Axes.ignore_existing_data_limits#18771l-johnston wants to merge 1 commit intomatplotlib:masterfrom l-johnston:issue_7742
Conversation
|
I think this is going the right direction, but we need to propagate the documentation changes back to bbox and I would also be inclined to make the default behavior in the switch "fail". If we did keep a non-erroring default state shouldn't it be the Is it worth looking into an |
|
I am not convinced that adding more epicycles is the way to go here. See writeup at #17106 (comment); the short version is basically "axes currently start with a datalim of (0, 1)/(0, 1) which is marked as 'ignore' so that later plots override it, but instead they should just start with a completely empty datalim and we should just use locator.nonsingular to expand it if needed at autoscaling time". |
|
I thought this was a problem with spans even after we had added a bunch of artists and did have real limits everywhere. We want to be able to update the limits only in the meaningful direction. |
|
But (I think) that's a separate point, which should not be controlled by a flag on the bbox, but rather by checking whether the artist transform "contains" transData in that direction (#13642 (review), #17017 (comment)). |
|
I don't know how easy the solution I proposed would be to implement, but yes, you can open a separate PR for it. |
PR Summary
Solving #7742 requires finer-grain control over which data limits to update during the call to
update_path_extents. A previous attempt at solving this problem, PR #8210, simply tried to keepignore_existing_data_limits=Truewhen plotting spans, but this approach fails when adding a second span.Adding this feature probably impacts #18401 and #17106.
PR Checklist
pytestpasses).flake8on changed files to check).flake8-docstringsandpydocstyle<4and runflake8 --docstring-convention=all).doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).