File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
examples/images_contours_and_fields Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 20
20
import matplotlib .pyplot as plt
21
21
import numpy as np
22
22
23
- import matplotlib as mpl
23
+ import matplotlib .colorizer as mcolorizer
24
+ import matplotlib .colors as mcolors
24
25
25
26
np .random .seed (19680801 )
26
27
32
33
fig , axs = plt .subplots (2 , 2 )
33
34
fig .suptitle ('Multiple images' )
34
35
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 )
38
39
39
40
images = []
40
41
for ax , data in zip (axs .flat , datasets ):
61
62
# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar`
62
63
# - `matplotlib.colorizer.Colorizer`
63
64
# - `matplotlib.colors.Normalize`
64
- # - `matplotlib.cbook.CallbackRegistry.connect`
Original file line number Diff line number Diff line change 8
8
This tutorial shows how to build and customize standalone colorbars, i.e.
9
9
without an attached plot.
10
10
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
15
14
use a `.ColorizingArtist` with no associated data.
15
+
16
16
"""
17
17
18
18
import matplotlib .pyplot as plt
You can’t perform that action at this time.
0 commit comments