Commit b84775c
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 f008953 commit b84775c
File tree
6 files changed
+162
-178
lines changed- doc/users/prev_whats_new
- examples
- color
- images_contours_and_fields
- lib/matplotlib
- tests
6 files changed
+162
-178
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
| 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