Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
DOC: add a couple more placement examples, crosslink axes_grid [ci doc]#26914
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
1115c7f
to3ca96ad
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The new examples look good to me.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
# %% | ||
# Manually placing colorbars | ||
# ========================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I wonder if this and the previous section should be two subsections under this title, since in both we are encouraging the user to do it manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
OK, I rearranged somewhat. Need to see how it looks before I decide where to link
Inset axes placement is controlled as for legends: either by providing a *loc* | ||
option ("upper right", "best", ...), or by providing a locator with respect to | ||
the parent bbox. Parameters such as *bbox_to_anchor* and *borderpad* likewise | ||
work in the same way, and are also demonstrated here. | ||
Users should consider using `.Axes.inset_axes` instead (see | ||
:ref:`colorbar_placement`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
If the last two sections of the colorbar guide become one "Manually Placing Colorbars" section (see other comment), then this could link directly to that.
Uh oh!
There was an error while loading.Please reload this page.
08926c5
toc234384
Comparec234384
to4f75570
Comparefig.colorbar(pcm, ax=axs[1], shrink=0.6) | ||
# %% | ||
# This is usual undesired, and can be worked around in various ways, e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
# This isusual undesired, and can be worked around in various ways, e.g. | |
# This isusually undesired, and can be worked around in various ways, e.g. |
Automatic placement | ||
=================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Automaticplacement | |
=================== | |
Automaticplacementofcolorbars | |
================================ |
For consistency with the "Manual" section below. Or make the other title short to match this, but I think the longer titles would be better if other parts of the docs link to specific sections?
# :ref:`axes_grid` has methods for creating colorbar axes as well: | ||
# | ||
# - :ref:`demo-colorbar-with-inset-locator` | ||
# - :ref:`demo-colorbar-with-axes-divider` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Think the "see also" should be at the bottom of the page?
#We solvethisproblem using`.Axes.inset_axes` to locate the axes in axes | ||
# coordinates. Note that if you zoom in on the axes, and thus | ||
# change the shape of the axes, the colorbar will also change position. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
# We solve this problem using `.Axes.inset_axes` to locate theaxes in axes | |
#coordinates. Note that if you zoom in on the axes, and thus | |
# change the shape ofthe axes, the colorbar will also change position. | |
# We solve this problem using `.Axes.inset_axes` to locate thecolorbar relative to the | |
#parent axes. Note that if you zoom in on the parent axes, and thus | |
# change the shape ofit, the colorbar will also change position. |
I appreciate this paragraph isn't new, but I feel like there are too many "axes" in there and it could be more specific about which axes each one refers to...!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Went with the similar with a link out to the jargon:
# We solve this problem using `.Axes.inset_axes` to locate the axes in "axes# coordinates" (see :ref:`transforms_tutorial`). Note that if you zoom in on# the parent axes, and thus change the shape of it, the colorbar will also# change position.
3ca0e25
tofdf1f25
CompareCo-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
fdf1f25
toab94dd7
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good to me.
…es, crosslink axes_grid [ci doc]
…es, crosslink axes_grid [ci doc]
…914-on-v3.8.0-docBackport PR#26914 on branch v3.8.0-doc (DOC: add a couple more placement examples, crosslink axes_grid [ci doc])
…914-on-v3.8.xBackport PR#26914 on branch v3.8.x (DOC: add a couple more placement examples, crosslink axes_grid [ci doc])
Noted inSciTools/cartopy#2248 (comment) - placing colorbars inside axes is sometimes a good thing to do (think a map, where you know you have no data coloured over a body of water, so the colorbar fits nicely there). This adds a couple of simple examples to show how to do that. Also crosslink from
demo-colorbar-with-inset-locator
anddemo-colorbar-with-axes-divider
and added some notes that these methods can typically be accomplished by easier means.