Preserve set_extent across ticklen format - #518
Conversation
|
Failures of the tests can be ignored btw -- docs are fixed on a different PR. |
set_extent across ticklen format
|
As of commit 677aec2, I'm not quite following your logic, but I don't think issue 517 has been resolved. The extent messing up may not be caused by "label-padding expansion", and the bug was recently introduced into the code. |
|
Whwn setting extend through format, a small space will be added to ensure that the labels will be visible. It is a thing that was present in proplot, and caused some issues for users in the past. When extent is used now, it will override it. I can do some testing to see if we should get rid of the epsilon all together or not. |
|
Ah I see the issue indeed -- sorry just woke up. That is a separate issue. |
Oh, I see. I didn't notice the small space added for label visiblity. What I meant was some format stuff caused the extent changed a lot, and format(lonlim=.., latlim=..) didn't respect the extent. |
|
The code you provided in that issue will now respect it after you set with extent but still uses the default epsilon stuff for when format is used |
|
More succintly your code now produces: python test.py
After set extent using lonlim and latlim: (0.22999999999999998, 2.42, 0.31000000000000005, 2.4699999999999998)
After set extent using set_extent : (0.73, 1.92, 0.81, 1.97)
After format something other than extent: (0.73, 1.92, 0.81, 1.97) |
|
Yes, the result shows exactly it's not. the result is: while it should be : (0.73, 1.92, 0.81, 1.97) |
|
As I indicated above the default formatting will add this epsilon if you add it through format. What this PR does is respect the limits after a set_extent is called -- it does not alter the behavior of the epsilon being added when called using |
|
As the doc indicats, And this issue doesn't come from proplot, though I haven't test every version, but it's recently. For example, in ultraplot v1.66.0, the issue is not there yet. Might came from v1.70.0 |
|
Ok @gepcel aligned them now |
| params.update({"length": size}) | ||
| params.pop("grid_alpha", None) | ||
| # Avoid overriding gridliner label toggles via tick_params defaults. | ||
| for key in ("labeltop", "labelbottom", "labelleft", "labelright"): |
There was a problem hiding this comment.
I'm not very proficient with Git workflows yet. I see here it means revert and drop changes from pull #520? Or keep pull 520?
There was a problem hiding this comment.
There is but I manually fixed it. It is fine for now I think I'm spreading myself too thing recently

Closes #517
This PR fixes a cartopy GeoAxes regression where calling
format(..., ticklen=...)would silently override a previously setset_extent()by reapplying_update_extent()with the label-padding expansion. The new logic only refreshes extent when the user explicitly passes extent-related arguments (lonlim/latlim/boundinglat). Otherwise, tick length updates preserve the current extent by reapplying the existing view intervals. A regression test is included to ensureset_extent()remains stable across ticklen-only format calls.