-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Make colorbar compatible accepting a list of axes created via gridspec #8755
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
Can you squash this to one or two commits? |
Removed some debug statements and old comments; whitespace / line wrapping. In particular, debug comments which simply indicate that a function has been called can easily be replaced by tools such as https://pypi.python.org/pypi/hunter or https://pypi.python.org/pypi/smiley.
2.5.5 is what's in my conda env, and 2.6.1 is what's built with the local_freetype option and is used on Travis and AppVeyor without issue.
The result of id() is only guaranteed to be unique for objects that exist at the same time. This global integer is a quick and light way to ensure that new renderers that match an old one don't produce the same caching key.
The Mathtext tests should no longer be flaky based on the previous change. Mark some PS tests as flaky because they require a lock that sometimes gets stuck on AppVeyor due to the multiple processes.
As suggested by @anntzer.
Accept a wider range of iterables for `ax`.
…ng in magnitude_spectrum() and fixed doc string.
when building packages (e.g. for openSUSE Linux) (random) filesystem order of input files influences ordering of functions in the output, thus without the patch, builds (in disposable VMs) would usually differ. See https://reproducible-builds.org/ for why this matters.
a7e484c
to
d9b49b5
Compare
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.
Nice work!
One small API change this should be reverted.
This needs a whats_new entry and an example.
@docstring.Substitution(make_axes_kw_doc) | ||
def make_axes_gridspec(parent, **kw): | ||
def make_axes_gridspec(parents, **kw): |
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.
Changing the argument name is an API change (as make_akes_gridspec(parent=obj)
will be broken).
# the maximum and minimum index into the subplotspec. The result is the | ||
# size the new gridspec that we will create must be. | ||
gsp0 = parents[0].get_subplotspec().get_gridspec() | ||
minind = 10000 |
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.
Probably better to use np.inf
and -np.inf
or use the values from the first parent.
@@ -13,19 +13,19 @@ | |||
# set this to True. It will download and build a specific version of | |||
# FreeType, and then use that to build the ft2font extension. This | |||
# ensures that test images are exactly reproducible. | |||
#local_freetype = False | |||
local_freetype = True |
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.
These changes should not be committed
Hmm, apparently not.. added a bunch of other files somehow. Sigh |
You need to force-push to github, at some point when you are trying to push the rebased branch it is saying "Can not push, please merge upstream changes first"? See #2742 for detailed instructions on how to deal with rebasing (which has annoyingly been removed from our built documentation...) |
yeah, but I did my rebase wrong. I foolishly thought I didn't have to count the commits... I'm going to start over. Sorry for my bad git skills |
I strongly recommend using Cherry-picking ranges can also be superhelpful for fixing this sort of thing. http://tom.preston-werner.com/2009/05/19/the-git-parable.html <- this is what made me actually understand git. |
and making git-snarls is an unfortunate, but real part of learning to use git. |
I'll maintain that I understand git just fine, but git doesn't understand me ;-) |
PR Summary
Similar to #8739, but modifies
make_axes_gridspec
incolorbar.py
.This is a change to make
figure.colorbar(ppm,ax=parents)
accept a list of parents that areSubplotBase
, and were created bygridspec
and return a colorbar that isSubplotBase
. So a call like:works with
axs
as a list, andcolorbar
taking space from all the axes listed byaxs
, andtight_layout()
able to operate on all axes including the colorbar.I think it works for most edge cases. I hesitated to edit the test suite, but could give that a try if desired.
PR Checklist