Skip to content

Commit 4ff1492

Browse files
committed
Added ipython section to code example near beginning
1 parent 588ebb1 commit 4ff1492

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
else:
4545
print("Using IPython's ipython_console_highlighting directive")
4646
extensions.append('IPython.sphinxext.ipython_console_highlighting')
47-
47+
extensions.append('IPython.sphinxext.ipython_directive')
4848
try:
4949
import numpydoc
5050
except ImportError:

doc/users/colormapnorms.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Colormap Normaliztions
44
================================
55

6-
Objects that use colormaps usually linearly map the colors in the
6+
Objects that use colormaps by default linearly map the colors in the
77
colormap from data values *vmin* to *vmax*. For example::
88

99
pcm = ax.pcolormesh(x, y, Z, vmin=-1., vmax=1., cmap='RdBu_r')
@@ -19,10 +19,16 @@ colormap. Normalizations are defined as part of
1919
:func:`matplotlib.colors.Normalize`. The artists that map data to
2020
color pass the arguments *vmin* and *vmax* to
2121
:func:`matplotlib.colors.Normalize`. We can substnatiate the
22-
normalization and see what it returns. In this case it returns 0.5::
22+
normalization and see what it returns. In this case it returns 0.5:
2323

24-
norm = mpl.colors.Normalize(vmin=-1., vmax=1.)
25-
norm(0.)
24+
.. ipython::
25+
26+
In [1]: import matplotlib as mpl
27+
28+
In [2]: norm=mpl.colors.Normalize(vmin=-1.,vmax=1.)
29+
30+
In [3]: norm(0.)
31+
Out[3]: 0.5
2632

2733
However, there are sometimes cases where it is useful to map data to
2834
colormaps in a non-linear fashion.

0 commit comments

Comments
 (0)