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 2020import matplotlib .pyplot as plt
2121import numpy as np
2222
23- import matplotlib as mpl
23+ import matplotlib .colorizer as mcolorizer
24+ import matplotlib .colors as mcolors
2425
2526np .random .seed (19680801 )
2627
3233fig , axs = plt .subplots (2 , 2 )
3334fig .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
3940images = []
4041for ax , data in zip (axs .flat , datasets ):
6162# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar`
6263# - `matplotlib.colorizer.Colorizer`
6364# - `matplotlib.colors.Normalize`
64- # - `matplotlib.cbook.CallbackRegistry.connect`
Original file line number Diff line number Diff line change 88This tutorial shows how to build and customize standalone colorbars, i.e.
99without 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
1514use a `.ColorizingArtist` with no associated data.
15+
1616"""
1717
1818import matplotlib .pyplot as plt
You can’t perform that action at this time.
0 commit comments