-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
update colorbar.py make_axes_gridspec #16646
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks a lot for the PR. After a quick look this seems feasible and reasonable. Will probably need some tests, and you have a flake8 error (follow links under Travis CI). Can you also check that this works w/ |
should fix the pep8 failure
I have made a another commit, should fix the format error. |
Sorry, I forgot about this. This is not compatible with This needs tests and a what's new entry, but I don't see any reason why adding this would be a problem. |
BTW< don't be shy about pinging for review at a reasonable interval. |
Thank you for pushing this PR forward, this is my 1st time to contribute to matplotlib, thus not very familiar with the procedure. What do I do next? I can see it fails the codecov test. |
If you can, it would be nice if you would add some tests, probably in |
Sorry for the delay. |
Sorry, this needs a rebase, and the docs should build as well. Please feel free to ping - I think this is a good addition. |
|
I rebased my commits into a branch named I will work on the docstring and example very soon. |
Since it was just me who has reviewed this so far, why not make things easier on ourselves and just open a new PR... Its better that you have the commits in a branch other than |
new PR done. Has merge conflicts |
Closed in lieu of #18340 |
PR Summary
I made a little change so that now the
anchor
argument inmake_axes_gridspec
mimic the behavior of that inmake_axes
. Now the postion of colorbar is determined byanchor
andshrink
, should be very useful whenshrink
< 1.0The effect is demostrated in the plot below. Now I can place the colorbar at different place with different shrinked size.
Before the change, we can achieve that using
ax.figure.colorbar(mappable, ax=ax, anchor=(0,0.3), use_gridspec=False)
, however, this will create a colorbar as aAxes
not aSubplot
, when I usesubplots_ajust
to adjust the border margins, I got the following plot.It seems the colorbar Axes is ignored and my plot is re-placed according to its
panchor
parameter thatmake_axes
set. It bothers me when I have multiple plots and wanna adjust the plots border margins and wspace, hspace.gridspec
offers a better approach and is the default setting when creating a colorbar, however, I want the colorbar to be 0.5 size and placed at the bottom right, which is mot implemented.So this is what I did basically.
PR Checklist