Repository navigation
Fix limit setting after plotting empty data - #17781
Conversation
|
Does this still work for plot? Ie can you add the same test for plot? |
|
Seems to work fine with plot, I've updated the test. The limits are slightly different between plot and scatter (I presume because plot doesn't have markers to take into account when autoscaling). |
|
Hmm. Really? We took the marker size logic out of the limits determination. I guess ideally they should be identical but if that’s beyond this PR I understand. |
|
This does not seem to fix the Could we do this test via the |
|
I figured out the fill_between issue (thanks for doing the hard work @dstansby !) and now it runs through the same codepath. Will push a commit with that fix and a change to the tests soon. |
tacaswell
left a comment
There was a problem hiding this comment.
I approve, but given that I now have commits on this branch, I don't want to merge it.
|
Thanks for tracking down fill_between and making the test a bit nicer by using |
| np.column_stack([ind[where], dep2[where]])]) | ||
| if ind_dir == "y": | ||
| pts = pts[:, ::-1] | ||
| self.dataLim.update_from_data_xy(pts, self.ignore_existing_data_limits, |
There was a problem hiding this comment.
Should this method get a comment that its usually meant to be called by Axes.update_datalim? We need more breadcrumbs for developers so they don't get lost amongst the many levels of redirection....
Ooops scrub that, I see that is a bbox method so general enough that folks shouldn't be looking there for axes-specific methods.
|
Awesome! |
…781-on-v3.3.x Backport PR #17781 on branch v3.3.x (Fix limit setting after plotting empty data)
Fixes #17586
This was a fun one to track down... It boiled down to plotting
[], []updating the datalims with[-inf, inf], which then setignore_existing_data_limitstoFalse. Having non-finite limits means thatignore_existing_data_limitsshouldn't be set toFalsethough, so now check that the limits are finite.