|
| 1 | +Changes to the default style |
| 2 | +---------------------------- |
| 3 | + |
| 4 | +The most important changes in matplotlib 2.0 are the changes to the |
| 5 | +default style. |
| 6 | + |
| 7 | +While it is impossible to select the best default for all cases, these |
| 8 | +are designed to work well in the most common cases. |
| 9 | + |
| 10 | +These changes include: |
| 11 | + |
| 12 | +Colors |
| 13 | +`````` |
| 14 | + |
| 15 | +- The default figure background color has changed from grey to white. |
| 16 | + Use the rcParam ``figure.facecolor`` to control this. |
| 17 | + |
| 18 | +- The default cycle of colors to draw lines, markers and other content |
| 19 | + has been changed. It is based on the `Vega category10 palette |
| 20 | + <https://github.com/vega/vega/wiki/Scales#scale-range-literals>`__. |
| 21 | + |
| 22 | +- The default color map used for images and pcolor meshes, etc., has |
| 23 | + changed from ``jet`` to ``viridis``. |
| 24 | + |
| 25 | +- For markers, scatter plots, bar charts and pie charts, there is no |
| 26 | + longer a black outline around filled markers by default. |
| 27 | + |
| 28 | +- Grid lines are light grey solid 1pt lines. They are no longer dashed by |
| 29 | + default. |
| 30 | + |
| 31 | +Plot layout |
| 32 | +``````````` |
| 33 | + |
| 34 | +- The default dpi used for on-screen is now 100, which is the same as |
| 35 | + the old default for saving files. Due to this, the on-screen |
| 36 | + display is now more what-you-see-is-what-you-get. |
| 37 | + |
| 38 | +- The number of ticks on an axis is now automatically determined based |
| 39 | + on the length of the axis. |
| 40 | + |
| 41 | +- The limits are scaled to exactly the dimensions of the data, plus 5% |
| 42 | + padding. The old behavior was to scale to the nearest "round" |
| 43 | + numbers. To use the old behavior, set the ``rcParam`` |
| 44 | + ``axes.autolimit_mode`` to ``round_numbers``. To control the |
| 45 | + margins on particular side individually, pass any of the following |
| 46 | + to any artist or plotting function: |
| 47 | + |
| 48 | + - ``top_margin=False`` |
| 49 | + - ``bottom_margin=False`` |
| 50 | + - ``left_margin=False`` |
| 51 | + - ``right_margin=False`` |
| 52 | + |
| 53 | +- Ticks now point outward by default. To have ticks pointing inward, |
| 54 | + use the ``rcParams`` ``xtick.direction`` and ``ytick.direction``. |
| 55 | + |
| 56 | +- By default, caps on the ends of errorbars are not present. Use the |
| 57 | + rcParam ``errorbar.capsize`` to control this. |
| 58 | + |
| 59 | +Images |
| 60 | +`````` |
| 61 | + |
| 62 | +- The default mode for image interpolation, in the rcParam |
| 63 | + ``image.interpolation``, is now ``nearest``. |
| 64 | + |
| 65 | +- The default shading mode for light source shading, in |
| 66 | + ``matplotlib.colors.LightSource.shade``, is now ``overlay``. |
| 67 | + Formerly, it was ``hsv``. |
| 68 | + |
| 69 | +- The default value for the rcParam ``image.resample`` is now |
| 70 | + ``True``. This will apply interpolation for both upsampling and |
| 71 | + downsampling of an image. |
| 72 | + |
| 73 | +Fonts |
| 74 | +````` |
| 75 | + |
| 76 | +- The default font has changed from "Bitstream Vera Sans" to "DejaVu |
| 77 | + Sans". "DejaVu Sans" is an improvement on "Bistream Vera Sans" that |
| 78 | + adds more international and math characters, but otherwise has the |
| 79 | + same appearance. |
| 80 | + |
| 81 | +- The default math font when using the built-in math rendering engine |
| 82 | + (mathtext) has changed from "Computer Modern" (i.e. LaTeX-like) to |
| 83 | + "DejaVu Sans". To revert to the old behavior, set the ``rcParam`` |
| 84 | + ``mathtext.fontset`` to ``cm``. This change has no effect if the |
| 85 | + TeX backend is used (i.e. ``text.usetex`` is ``True``). |
| 86 | + |
| 87 | +Dates |
| 88 | +````` |
| 89 | + |
| 90 | +- The default date formats are now all based on ISO format, i.e., with |
| 91 | + the slowest-moving value first. The date formatters are still |
| 92 | + changeable through the ``date.autoformatter.*`` rcParams. Python's |
| 93 | + ``%x`` and ``%X`` date formats may be of particular interest to |
| 94 | + format dates based on the current locale. |
| 95 | + |
| 96 | +Legends |
| 97 | +``````` |
| 98 | + |
| 99 | +- By default, the number of points displayed in a legend is now 1. |
| 100 | + |
| 101 | +- The default legend location is ``best``, so the legend will be |
| 102 | + automatically placed in a location to obscure the least amount of |
| 103 | + data possible. |
| 104 | + |
| 105 | +- The legend now has rounded corners by default. |
0 commit comments