@@ -8,13 +8,16 @@ default style.
8
8
While it is impossible to select the best default for all cases, these
9
9
are designed to work well in the most common cases.
10
10
11
- A 'classic' style sheet will be provided so reverting to the 1.x
12
- default values will be a single line of python
11
+ A 'classic' style sheet is provided so reverting to the 1.x default
12
+ values is a single line of python
13
13
14
14
.. code ::
15
15
16
16
mpl.style.use('classic')
17
17
18
+ See :ref: `customizing-with-matplotlibrc-files ` for details about how to
19
+ persistently and selectively revert many of these changes.
20
+
18
21
19
22
colors, color cycles, and color maps
20
23
====================================
@@ -79,45 +82,84 @@ colors. This allows the first 10 colors in
79
82
``mpl.rcParms['axes.prop_cycle'] `` to be easily accessed. See
80
83
:ref: `colors ` for more details.
81
84
85
+ To restore only the old color cycle use
86
+
87
+ .. code ::
88
+
89
+ from cycler import cycler
90
+ mpl.rcParams['axes.prop_cycle'] = cycler(color='bgrcmyk')
91
+
92
+ or setting
93
+
94
+ .. code ::
95
+
96
+ axes.prop_cycle : cycler('color', 'bgrcmyk')
97
+
98
+ in your :file: `matplotlibrc ` file.
82
99
83
100
Colormap
84
101
--------
85
102
86
103
87
- ``matplotlib `` is changing the default colormap and styles in the
88
- upcoming 2.0 release!
104
+ The new default color map used by `matplotlib.cm.ScalarMappable ` instances is
105
+ `'viridis' ` (aka `option D <http://bids.github.io/colormap/ >`__).
106
+
107
+ .. plot ::
108
+
109
+ import numpy as np
110
+ N = M = 200
111
+ X, Y = np.ogrid[0:20:N*1j, 0:20:M*1j]
112
+ data = np.sin(np.pi * X*2 / 20) * np.cos(np.pi * Y*2 / 20)
113
+
114
+ fig, ax = plt.subplots()
115
+ im = ax.imshow(data, extent=[0, 200, 0, 200])
116
+ fig.colorbar(im)
117
+ ax.set_title('viridis')
89
118
90
- The new default color map will be 'viridis' (aka `option
91
- D <http://bids.github.io/colormap/> `_). For an introduction to color
92
- theory and how 'viridis' was generated watch Nathaniel Smith and
93
- Stéfan van der Walt's talk from SciPy2015
119
+ For an introduction to color theory and how 'viridis' was generated
120
+ watch Nathaniel Smith and Stéfan van der Walt's talk from SciPy2015.
121
+ See `here for many more deatils <http://bids.github.io/colormap/ >`__
122
+ about the other alternatives and the tools used to create the color
123
+ map. For details on all of color maps available in matplotlib see
124
+ :ref: `colormaps `.
94
125
95
126
.. raw :: html
96
127
97
128
<iframe width =" 560" height =" 315" src =" https://www.youtube.com/embed/xAoljeRJ3lU" frameborder =" 0" allowfullscreen ></iframe >
98
129
99
130
131
+ The previous default can be restored using
132
+
133
+ .. code ::
100
134
101
- Other
102
- -----
135
+ mpl.rcParams['image.cmap'] = 'jet'
103
136
104
- - The default figure background color has changed from grey to white.
105
- Use the rcParam ``figure.facecolor `` to control this.
137
+ or setting
106
138
107
- - The default cycle of colors to draw lines, markers and other content
108
- has been changed.
139
+ .. code ::
109
140
110
- - The default color map used for images and pcolor meshes, etc., has
111
- changed from ``jet `` to ``viridis ``.
141
+ image.cmap : 'jet'
142
+
143
+ in your :file: `matplotlibrc ` file, however this is strongly discouraged.
144
+
145
+ Other colors
146
+ ------------
147
+
148
+ - The default interactive figure background color has changed from
149
+ grey to white. Use the rcParam ``figure.facecolor `` to control
150
+ this.
151
+
152
+ Grid lines
153
+ ----------
112
154
113
- - For markers, scatter plots, bar charts and pie charts, there is no
114
- longer a black outline around filled markers by default.
115
155
116
156
- Grid lines are light grey solid 1pt lines. They are no longer dashed by
117
157
default.
118
158
119
159
Plots
120
160
=====
161
+ - For markers, scatter plots, bar charts and pie charts, there is no
162
+ longer a black outline around filled markers by default.
121
163
122
164
- The default size of the elements in a scatter plot is now based on
123
165
the rcParam ``lines.markersize `` so it is consistent with ``plot(X,
0 commit comments