Make all parameters of ColorbarBase, except ax, keyword-only.#17189
Merged
timhoffm merged 1 commit intomatplotlib:masterfrom Apr 19, 2020
Merged
Make all parameters of ColorbarBase, except ax, keyword-only.#17189timhoffm merged 1 commit intomatplotlib:masterfrom
ax, keyword-only.#17189timhoffm merged 1 commit intomatplotlib:masterfrom
Conversation
This is consistent with Colorbar. Moreover, this will make it possibly to ultimately merge Colorbar into ColorbarBase -- currently, they only differ by the fact that a ColorbarBase doesn't have an associated ScalarMappable, but we can just construct an empty ScalarMappable in that case (this is already what we document as recommended approach to construct colorbars not attached to an artist -- `fig.colorbar(ScalarMappable(norm=..., cmap=...))`. Right now this merging is *nearly* possible except for the fact that the constructors' signatures are a pain to combine.
jklymak
approved these changes
Apr 19, 2020
timhoffm
approved these changes
Apr 19, 2020
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is consistent with Colorbar. Moreover, this will make it possibly
to ultimately merge Colorbar into ColorbarBase -- currently, they only
differ by the fact that a ColorbarBase doesn't have an associated
ScalarMappable, but we can just construct an empty ScalarMappable in
that case (this is already what we document as recommended approach to
construct colorbars not attached to an artist --
fig.colorbar(ScalarMappable(norm=..., cmap=...)). Right now thismerging is nearly possible except for the fact that the constructors'
signatures are a pain to combine.
An alternative strategy may be to just deprecate ColorbarBase and move it all into Colorbar, but I guess that would be more disruptive.
PR Summary
PR Checklist