Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updates based on code review
  • Loading branch information
trygvrad committed Jun 1, 2025
commit 155ae8a496e6a3faad6a9d7b3c7f5aa2853532b5
10 changes: 5 additions & 5 deletions galleries/examples/images_contours_and_fields/multi_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
import matplotlib.pyplot as plt
import numpy as np

import matplotlib as mpl
import matplotlib.colorizer as mcolorizer
import matplotlib.colors as mcolors

np.random.seed(19680801)

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

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

images = []
for ax, data in zip(axs.flat, datasets):
Expand All @@ -61,4 +62,3 @@
# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar`
# - `matplotlib.colorizer.Colorizer`
# - `matplotlib.colors.Normalize`
# - `matplotlib.cbook.CallbackRegistry.connect`
8 changes: 4 additions & 4 deletions galleries/users_explain/colors/colorbar_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
This tutorial shows how to build and customize standalone colorbars, i.e.
without an attached plot.

A `~.Figure.colorbar` needs a "mappable" (`matplotlib.colorizer.ColorizingArtist`)
object (typically, an image) which contains a colorizer
(`matplotlib.colorizer.Colorizer`) that holds the data-to-color pipeline (norm and
colormap). In order to create a colorbar without an attached image, one can instead
A `~.Figure.colorbar` requires a `matplotlib.colorizer.ColorizingArtist` which
contains a `matplotlib.colorizer.Colorizer` that holds the data-to-color pipeline
(norm and colormap). To create a colorbar without an attached plot one can
use a `.ColorizingArtist` with no associated data.

"""

import matplotlib.pyplot as plt
Expand Down