Skip to content

Commit 155ae8a

Browse files
committed
Updates based on code review
1 parent 4af03f4 commit 155ae8a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

galleries/examples/images_contours_and_fields/multi_image.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
import matplotlib.pyplot as plt
2121
import numpy as np
2222

23-
import matplotlib as mpl
23+
import matplotlib.colorizer as mcolorizer
24+
import matplotlib.colors as mcolors
2425

2526
np.random.seed(19680801)
2627

@@ -32,9 +33,9 @@
3233
fig, axs = plt.subplots(2, 2)
3334
fig.suptitle('Multiple images')
3435

35-
# create a single norm and colorizer to be shared across all images
36-
norm = mpl.colors.Normalize(vmin=np.min(datasets), vmax=np.max(datasets))
37-
colorizer = mpl.colorizer.Colorizer(norm=norm)
36+
# create a colorizer with a predefined norm to be shared across all images
37+
norm = mcolors.Normalize(vmin=np.min(datasets), vmax=np.max(datasets))
38+
colorizer = mcolorizer.Colorizer(norm=norm)
3839

3940
images = []
4041
for ax, data in zip(axs.flat, datasets):
@@ -61,4 +62,3 @@
6162
# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar`
6263
# - `matplotlib.colorizer.Colorizer`
6364
# - `matplotlib.colors.Normalize`
64-
# - `matplotlib.cbook.CallbackRegistry.connect`

galleries/users_explain/colors/colorbar_only.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
This tutorial shows how to build and customize standalone colorbars, i.e.
99
without an attached plot.
1010
11-
A `~.Figure.colorbar` needs a "mappable" (`matplotlib.colorizer.ColorizingArtist`)
12-
object (typically, an image) which contains a colorizer
13-
(`matplotlib.colorizer.Colorizer`) that holds the data-to-color pipeline (norm and
14-
colormap). In order to create a colorbar without an attached image, one can instead
11+
A `~.Figure.colorbar` requires a `matplotlib.colorizer.ColorizingArtist` which
12+
contains a `matplotlib.colorizer.Colorizer` that holds the data-to-color pipeline
13+
(norm and colormap). To create a colorbar without an attached plot one can
1514
use a `.ColorizingArtist` with no associated data.
15+
1616
"""
1717

1818
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)