@@ -22,6 +22,172 @@ revision, see the :ref:`github-stats`.
22
22
23
23
next_whats_new/*
24
24
25
+ Ability to scale axis by a fixed order of magnitude
26
+ ---------------------------------------------------
27
+
28
+ To scale an axis by a fixed order of magnitude, set the *scilimits * argument of
29
+ ``Axes.ticklabel_format `` to the same (non-zero) lower and upper limits. Say to scale
30
+ the y axis by a million (1e6), use ``ax.ticklabel_format(style='sci', scilimits=(6, 6), axis='y') ``.
31
+
32
+ The behavior of ``scilimits=(0, 0) `` is unchanged. With this setting, matplotlib will adjust
33
+ the order of magnitude depending on the axis values, rather than keeping it fixed. Previously, setting
34
+ ``scilimits=(m, m) `` was equivalent to setting ``scilimits=(0, 0) ``.
35
+
36
+
37
+ Add ``AnchoredDirectionArrows `` feature to mpl_toolkits
38
+ --------------------------------------------------------
39
+
40
+ A new mpl_toolkits class
41
+ :class: `~mpl_toolkits.axes_grid1.anchored_artists.AnchoredDirectionArrows `
42
+ draws a pair of orthogonal arrows to inidcate directions on a 2D plot. A
43
+ minimal working example takes in the transformation object for the coordinate
44
+ system (typically ax.transAxes), and arrow labels. There are several optional
45
+ parameters that can be used to alter layout. For example, the arrow pairs can
46
+ be rotated and the color can be changed. By default the labels and arrows have
47
+ the same color, but the class may also pass arguments for costumizing arrow
48
+ and text layout, these are passed to :class: `matplotlib.text.TextPath ` and
49
+ `matplotlib.patches.FancyArrowPatch `. Location, length and width for both
50
+ arrow tail and head can be adjusted, the the direction arrows and labels can
51
+ have a frame. Padding and separation parameters can be adjusted.
52
+
53
+
54
+ Add ``minorticks_on()/off() `` methods for colorbar
55
+ --------------------------------------------------
56
+
57
+ A new method :meth: `.Colobar.minorticks_on ` is
58
+ introduced to correctly display minor ticks on the colorbar. This method
59
+ doesn't allow the minor ticks to extend into the regions beyond vmin and vmax
60
+ when the extend `kwarg ` (used while creating the colorbar) is set to 'both',
61
+ 'max' or 'min'.
62
+ A complementary method :meth: `.Colobar.minorticks_off `
63
+ is introduced to remove the minor ticks on the colorbar.
64
+
65
+
66
+ Colorbar ticks can now be automatic
67
+ -----------------------------------
68
+
69
+ The number of ticks on colorbars was appropriate for a large colorbar, but
70
+ looked bad if the colorbar was made smaller (i.e. via the ``shrink `` kwarg).
71
+ This has been changed so that the number of ticks is now responsive to how
72
+ large the colorbar is.
73
+
74
+
75
+ Cyclic colormaps
76
+ ----------------
77
+
78
+ Two new colormaps named 'twilight' and 'twilight_shifted' were added.
79
+ These colormaps start and end on the same color, and have two
80
+ symmetric halves with equal lightness, but diverging color. Since they
81
+ wrap around, they are a good choice for cyclic data such as phase
82
+ angles, compass directions, or time of day. Like viridis, twilight is
83
+ perceptually uniform and colorblind friendly.
84
+
85
+
86
+ Stop adding a suffix to suggest unique file name
87
+ ------------------------------------------------
88
+
89
+ Previously, when saving a figure to a file using the GUI's
90
+ save dialog box, if the default filename (based on the
91
+ figure window title) already existed on disk, Matplotlib
92
+ would append a suffix (e.g. `Figure_1-1.png `), preventing
93
+ the dialog from prompting to overwrite the file. This
94
+ behaviour has been removed. Now if the file name exists on
95
+ disk, the user is prompted whether or not to overwrite it.
96
+ This eliminates guesswork, and allows intentional
97
+ overwriting, especially when the figure name has been
98
+ manually set using `fig.canvas.set_window_title() `.
99
+
100
+
101
+ Legend now has a title_fontsize kwarg (and rcParam)
102
+ ---------------------------------------------------
103
+
104
+ The title for a `.Figure.legend ` and `.Axes.legend ` can now have its
105
+ fontsize set via the ``title_fontsize `` kwarg. There is also a new
106
+ :rc: `legend.title_fontsize `. Both default to ``None ``, which means
107
+ the legend title will have the same fontsize as the axes default fontsize
108
+ (*not * the legend fontsize, set by the ``fontsize `` kwarg or
109
+ :rc: `legend.fontsize `).
110
+
111
+
112
+ Implemented support for axes.prop_cycle property markevery in rcParams
113
+ ----------------------------------------------------------------------
114
+
115
+ The Matplotlib ``rcParams `` settings object now supports configuration
116
+ of the attribute `axes.prop_cycle ` with cyclers using the `markevery `
117
+ Line2D object property. An example of this feature is provided at
118
+ `~matplotlib/examples/lines_bars_and_markers/markevery_prop_cycle.py `
119
+
120
+ Multipage PDF support for pgf backend
121
+ -------------------------------------
122
+
123
+ The pgf backend now also supports multipage PDF files.
124
+
125
+ .. code-block :: python
126
+
127
+ from matplotlib.backends.backend_pgf import PdfPages
128
+ import matplotlib.pyplot as plt
129
+
130
+ with PdfPages(' multipage.pdf' ) as pdf:
131
+ # page 1
132
+ plt.plot([2 , 1 , 3 ])
133
+ pdf.savefig()
134
+
135
+ # page 2
136
+ plt.cla()
137
+ plt.plot([3 , 1 , 2 ])
138
+ pdf.savefig()
139
+
140
+
141
+ Pie charts are now circular by default
142
+ --------------------------------------
143
+ We acknowledge that the majority of people do not like egg-shaped pies.
144
+ Therefore, an axes to which a pie chart is plotted will be set to have
145
+ equal aspect ratio by default. This ensures that the pie appears circular
146
+ independent on the axes size or units. To revert to the previous behaviour
147
+ you may set the axes' aspect to automatic, ax.set_aspect("auto") or
148
+ plt.axis("auto").
149
+
150
+ Add ``ax.get_gridspec `` to `.SubplotBase `
151
+ -----------------------------------------
152
+
153
+ New method `.SubplotBase.get_gridspec ` is added so that users can
154
+ easily get the gridspec that went into making an axes:
155
+
156
+ .. code ::
157
+
158
+ import matplotlib.pyplot as plt
159
+
160
+ fig, axs = plt.subplots(3, 2)
161
+ gs = axs[0, -1].get_gridspec()
162
+
163
+ # remove the last column
164
+ for ax in axs[:,-1].flatten():
165
+ ax.remove()
166
+
167
+ # make a subplot in last column that spans rows.
168
+ ax = fig.add_subplot(gs[:, -1])
169
+ plt.show()
170
+
171
+
172
+ Axes title will no longer overlap xaxis
173
+ ---------------------------------------
174
+
175
+ Previously an axes title had to be moved manually if an xaxis overlapped
176
+ (usually when the xaxis was put on the top of the axes). Now, the title
177
+ will be automatically moved above the xaxis and its decorators (including
178
+ the xlabel) if they are at the top.
179
+
180
+ If desired, the title can still be placed manually. There is a slight kludge;
181
+ the algorithm checks if the y-position of the title is 1.0 (the default),
182
+ and moves if it is. If the user places the title in the default location
183
+ (i.e. ``ax.title.set_position(0.5, 1.0) ``), the title will still be moved
184
+ above the xaxis. If the user wants to avoid this, they can
185
+ specify a number that is close (i.e. ``ax.title.set_position(0.5, 1.01) ``)
186
+ and the title will not be moved via this algorithm.
187
+
188
+
189
+
190
+
25
191
26
192
27
193
0 commit comments