For a list of all of the issues and pull requests since the last revision, see the GitHub Stats.
Table of Contents
matplotlib 2.0 supports Python 2.7, and 3.4+
The major changes in v2.0 are related to overhauling the default styles.
colors gained a new color conversion API with
full support for the alpha channel. The main public functions are
RGBA quadruplets are encoded in hex format as
A side benefit is that the Qt options editor now allows setting the alpha channel of the artists as well.
New rcparams added
||format string for ‘year’ scale dates|
||format string for ‘month’ scale dates|
||format string for ‘day’ scale dates|
||format string for ‘hour’ scale times|
||format string for ‘minute’ scale times|
||format string for ‘second’ scale times|
||format string for ‘microsecond’ scale times|
||default marker for scatter plot|
||Control where major and minor ticks are drawn.
The global values are
||The default number of bins to use in
||Whether the line dash patterns should scale with linewidth.|
||Minimum number of digits saved in tick labels that triggers using an offset.|
svg.hashsaltkey to rcParams¶
None (which it is by default), the svg
uuid4 to generate the hash salt. If it is not
None, it must be a string that is used as the hash salt instead of
uuid4. This allows for deterministic SVG output.
As a result of the extensive changes to image handling, the
svg.image_noscale rcParam has been removed. The same
functionality may be achieved by setting
individual images or globally using the
ColorBrewer’s “qualitative” colormaps (“Accent”, “Dark2”, “Paired”,
“Pastel1”, “Pastel2”, “Set1”, “Set2”, “Set3”) were intended for discrete
categorical data, with no implication of value, and therefore have been
ListedColormap instead of
the colors will no longer be interpolated and they can be used for
choropleths, labeled image features, etc.
Axis offset labels are now colored the same as axis tick markers when
labelcolor is altered.
The default offset-text choice was changed to only use significant digits that are common to all ticks (e.g. 1231..1239 -> 1230, instead of 1231), except when they straddle a relatively large multiple of a power of ten, in which case that multiple is chosen (e.g. 1999..2001->2000).
In order to prevent unexpected consequences from using a style, style files are no longer able to set parameters that affect things unrelated to style. These parameters include:
'interactive', 'backend', 'backend.qt4', 'webagg.port', 'webagg.port_retries', 'webagg.open_in_browser', 'backend_fallback', 'toolbar', 'timezone', 'datapath', 'figure.max_open_warning', 'savefig.directory', 'tk.window_focus', 'docstring.hardcopy'
The default font used by matplotlib in text has been changed to DejaVu Sans and DejaVu Serif for the sans-serif and serif families, respectively. The DejaVu font family is based on the previous matplotlib default –Bitstream Vera– but includes a much wider range of characters.
The default mathtext font has been changed from Computer Modern to the DejaVu
family to maintain consistency with regular text. Two new options for the
mathtext.fontset configuration parameter have been added:
dejavuserif. Both of these options use DejaVu glyphs whenever
possible and fall back to STIX symbols when a glyph is not found in DejaVu. To
return to the previous behavior, set the rcParam
Rendering text in the Agg backend is now less fuzzy and about 20% faster to draw.
Various usability improvements were implemented for the Qt figure options editor, among which:
Prior to version 2.0, matplotlib resampled images by first applying the color map and then resizing the result. Since the resampling was performed on the colored image, this introduced colors in the output image that didn’t actually exist in the color map. Now, images are resampled first (and entirely in floating-point, if the input image is floating-point), and then the color map is applied.
In order to make this important change, the image handling code was almost entirely rewritten. As a side effect, image resampling uses less memory and fewer datatype conversions than before.
The experimental private feature where one could “skew” an image by
setting the private member
_image_skew_coordinate has been
removed. Instead, images will obey the transform of the axes on which
they are drawn.
imshow() now draws data at the requested points in data space after the
application of non-linear scales.
The image on the left demonstrates the new, correct behavior.
The old behavior can be recreated using
demonstrated on the right.
This can be understood by analogy to plotting a histogram with linearly spaced bins with a logarithmic x-axis. Equal sized bins will be displayed as wider for small x and narrower for large x.
The NbAgg and WebAgg backends will now use the full resolution of your high-pixel-density display.
The default animation codec has been changed from
which is more efficient. It can be set via the
The use of mencoder for writing video files with mpl is problematic; switching to ffmpeg is strongly advised. All support for mencoder will be removed in version 2.2.
zorder parameter now exists for
boxplot(). This allows the zorder
of a boxplot to be set in the plotting function call.
As of v2.0, mplot3d’s
ccount arguments for controlling the sampling of the
input data for plotting. These arguments specify the maximum number of
evenly spaced samples to take from the input data. These arguments are
also the new default sampling method for the function, and is
considered a style change.
cstride arguments, which specified the size of the
evenly spaced samples, become the default when ‘classic’ mode is invoked,
and are still available for use. There are no plans for deprecating these