DOC: Fix example for what's new imshow so it isn't cut off or crowded. - #24441
Conversation
|
Suggest constrained layout and concise date formatter. |
|
I prefer the concise locator version, but I'm biased... |
|
I'm not going to block on that, but I don't find having 00:00 next to the day all that useful. |
|
Since this example has so many ticks so close together, I think this helps avoid confusion of the ticks being multiline entries e.g., |
|
Here's the updated page in the docs. This is also 3.7 #22230 |
dstansby
left a comment
There was a problem hiding this comment.
Looks 👍 - just two non-blocking suggestions. I think that having 00:00 next to the date is better than having just the date.
There was a problem hiding this comment.
Since this is about extents and not about date formatting, I propose to simplify the y ticks further:
- reduce to only one major tick per day (more ticks don't make sense because you have only one image pixel per day)
- thus, also don't activate minor ticks
- set the date format to "%d/%m%y" (no hours)
|
I would even leave out Optional: I also switched the x-extent from [1, 11], to [0, 10] because it looks slightly better to have ticks on the boundaries. But that's just a minor stylistic thing. |
|
I agree with @timhoffm – I will update the example. |




PR Summary
The example for the What's new entry on the

extentparameter toimshowcurrently has a very crowded y-axis and the labels are being cut off:I reduced the number of major ticks and adjusted the figure size in addition to calling

tight_layout()to fix this. It now looks like the below in the built docs.PR Checklist
Tests and Styling
pytestpasses).flake8-docstringsand runflake8 --docstring-convention=all).Documentation
Release Notes
.. versionadded::directive in the docstring and documented indoc/users/next_whats_new/.. versionchanged::directive in the docstring and documented indoc/api/next_api_changes/next_whats_new/README.rstornext_api_changes/README.rst