Commit 6e76ae6
committed
Merge Colorbar and ColorbarBase.
ColorbarBase differs from Colorbar in that it is not associated with a
ScalarMappable (but constructed from explicit cmap/norm), but we already
document in Figure.colorbar that the preferred way to draw colorbars not
associated with an existing artist is to create an empty ScalarMappable
to provide `norm` and `cmap`.
Hence, likewise merge Colorbar and ColorbarBase (creating the
ScalarMappable on-the-fly if no mappable is passed to the constructor),
which should make the APIs clearer. (Note that we are already
discouraging users to directly call either class' constructors,
anyways). We could deprecate the backcompat APIs (i.e., the
`ColorbarBase` alias, the `cmap` and `norm` kwargs, and the different
semantics of `add_lines`), but that can be done later; this PR should be
entirely backcompatible.1 parent a3fbf18 commit 6e76ae6
File tree
3 files changed
+157
-175
lines changed- examples
- color
- images_contours_and_fields
- lib/matplotlib
3 files changed
+157
-175
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
0 commit comments