|
| 1 | +Behaviour Changes |
| 2 | +----------------- |
| 3 | + |
| 4 | +plot() shorthand format interprets "Cn" (n>9) as a color-cycle color |
| 5 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 | + |
| 7 | +Previously, ``plot(..., "-C11")`` would be interpreted as requesting a plot using |
| 8 | +linestyle "-", color "C1" (color #1 of the color cycle), and marker "1" ("tri-down"). |
| 9 | +It is now interpreted as requesting linestyle "-" and color "C11" (color #11 of the |
| 10 | +color cycle). |
| 11 | + |
| 12 | +It is recommended to pass ambiguous markers (such as "1") explicitly using the *marker* |
| 13 | +keyword argument. If the shorthand form is desired, such markers can also be |
| 14 | +unambiguously set by putting them *before* the color string. |
| 15 | + |
| 16 | +Legend labels for ``plot`` |
| 17 | +^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 18 | + |
| 19 | +Previously if a sequence was passed to the *label* parameter of `~.Axes.plot` when |
| 20 | +plotting a single dataset, the sequence was automatically cast to string for the legend |
| 21 | +label. Now, if the sequence has only one element, that element will be the legend label. |
| 22 | +To keep the old behavior, cast the sequence to string before passing. |
| 23 | + |
| 24 | +Boxplots now ignore masked data points |
| 25 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 26 | + |
| 27 | +`~matplotlib.axes.Axes.boxplot` and `~matplotlib.cbook.boxplot_stats` now ignore any |
| 28 | +masked points in the input data. |
| 29 | + |
| 30 | +Default behavior of ``hexbin`` with *C* provided requires at least 1 point |
| 31 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 32 | + |
| 33 | +The behavior changed in 3.8.0 to be inclusive of *mincnt*. However that resulted in |
| 34 | +errors or warnings with some reduction functions, so now the default is to require at |
| 35 | +least 1 point to call the reduction function. This effectively restores the default |
| 36 | +behavior to match that of Matplotlib 3.7 and before. |
| 37 | + |
| 38 | +``axhspan`` and ``axvspan`` now return ``Rectangle``\s, not ``Polygon``\s |
| 39 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 40 | + |
| 41 | +This change allows using `~.Axes.axhspan` to draw an annulus on polar axes. |
| 42 | + |
| 43 | +This change also affects other elements built via `~.Axes.axhspan` and `~.Axes.axvspan`, |
| 44 | +such as ``Slider.poly``. |
| 45 | + |
| 46 | +Improved handling of pan/zoom events of overlapping Axes |
| 47 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 48 | + |
| 49 | +The forwarding of pan/zoom events is now determined by the visibility of the |
| 50 | +background-patch (e.g. ``ax.patch.get_visible()``) and by the ``zorder`` of the axes. |
| 51 | + |
| 52 | +- Axes with a visible patch capture the event and do not pass it on to axes below. Only |
| 53 | + the Axes with the highest ``zorder`` that contains the event is triggered (if there |
| 54 | + are multiple Axes with the same ``zorder``, the last added Axes counts) |
| 55 | +- Axes with an invisible patch are also invisible to events and they are passed on to |
| 56 | + the axes below. |
| 57 | + |
| 58 | +To override the default behavior and explicitly set whether an Axes should forward |
| 59 | +navigation events, use `.Axes.set_forward_navigation_events`. |
| 60 | + |
| 61 | +``loc='best'`` for ``legend`` now considers ``Text`` and ``PolyCollections`` |
| 62 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 63 | + |
| 64 | +The location selection ``legend`` now considers the existence of ``Text`` and |
| 65 | +``PolyCollections`` in the ``badness`` calculation. |
| 66 | + |
| 67 | +Note: The ``best`` option can already be quite slow for plots with large amounts of |
| 68 | +data. For ``PolyCollections``, it only considers the ``Path`` of ``PolyCollections`` and |
| 69 | +not the enclosed area when checking for overlap to reduce additional latency. However, |
| 70 | +it can still be quite slow when there are large amounts of ``PolyCollections`` in the |
| 71 | +plot to check for. |
| 72 | + |
| 73 | +Exception when not passing a Bbox to BboxTransform*-classes |
| 74 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 75 | + |
| 76 | +The exception when not passing a Bbox to BboxTransform*-classes that expect one, e.g., |
| 77 | +`~matplotlib.transforms.BboxTransform` has changed from ``ValueError`` to ``TypeError``. |
| 78 | + |
| 79 | +*loc* parameter of ``Cell`` no longer accepts ``None`` |
| 80 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 81 | + |
| 82 | +The default value of the *loc* parameter has been changed from ``None`` to ``right``, |
| 83 | +which already was the default location. The behavior of `.Cell` didn't change when |
| 84 | +called without an explicit *loc* parameter. |
| 85 | + |
| 86 | +``ContourLabeler.add_label`` now respects *use_clabeltext* |
| 87 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 88 | + |
| 89 | +... and sets `.Text.set_transform_rotates_text` accordingly. |
| 90 | + |
| 91 | +``Line2D`` |
| 92 | +^^^^^^^^^^ |
| 93 | + |
| 94 | +When creating a Line2D or using `.Line2D.set_xdata` and `.Line2D.set_ydata`, |
| 95 | +passing x/y data as non sequence is now an error. |
| 96 | + |
| 97 | +``ScalarMappable``\s auto-scale their norm when an array is set |
| 98 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 99 | + |
| 100 | +Collections previously deferred auto-scaling of the norm until draw time. This has been |
| 101 | +changed to scale the norm whenever the first array is set to align with the docstring |
| 102 | +and reduce unexpected behavior when accessing the norm before drawing. |
| 103 | + |
| 104 | +``SubplotParams`` moved from ``matplotlib.figure`` to ``matplotlib.gridspec`` |
| 105 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 106 | + |
| 107 | +It is still importable from ``matplotlib.figure``, so does not require any changes to |
| 108 | +existing code. |
| 109 | + |
| 110 | +``PowerNorm`` no longer clips values below vmin |
| 111 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 112 | + |
| 113 | +When ``clip=False`` is set (the default) on `~matplotlib.colors.PowerNorm`, values below |
| 114 | +``vmin`` are now linearly normalised. Previously they were clipped to zero. This fixes |
| 115 | +issues with the display of colorbars associated with a power norm. |
| 116 | + |
| 117 | +Image path semantics of toolmanager-based tools |
| 118 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 119 | + |
| 120 | +Previously, MEP22 ("toolmanager-based") Tools would try to load their icon |
| 121 | +(``tool.image``) relative to the current working directory, or, as a fallback, from |
| 122 | +Matplotlib's own image directory. Because both approaches are problematic for |
| 123 | +third-party tools (the end-user may change the current working directory at any time, |
| 124 | +and third-parties cannot add new icons in Matplotlib's image directory), this behavior |
| 125 | +is deprecated; instead, ``tool.image`` is now interpreted relative to the directory |
| 126 | +containing the source file where the ``Tool.image`` class attribute is defined. |
| 127 | +(Defining ``tool.image`` as an absolute path also works and is compatible with both the |
| 128 | +old and the new semantics.) |
0 commit comments