8000 Deprecate Colorbar.patch. · ianhi/matplotlib@92a3fc4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 92a3fc4

Browse files
committed
Deprecate Colorbar.patch.
It is not used at all anymore (its vertices are not even set correctly) since the switch to ColorbarAxes.
1 parent 3d5c6d5 commit 92a3fc4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

doc/api/next_api_changes/behavior/20054-JMK.rst

Lines changed: 5 additions & 0 deletions
< 8000 ul aria-label="File view" class="prc-SegmentedControl-SegmentedControl-e7570 mx-2" data-size="small">
  • Original file line numberDiff line numberDiff line change
    @@ -5,3 +5,8 @@ If a colorbar has lines added to it (e.g. for contour lines), these will
    55
    no longer be clipped. This is an improvement for lines on the edge of
    66
    the colorbar, but could lead to lines off the colorbar if the limits of
    77
    the colorbar are changed.
    8+
    9+
    ``Colorbar.patch`` is deprecated
    10+
    ================================
    11+
    12+
    This attribute is not correctly updated anymore.

    lib/matplotlib/colorbar.py

    Lines changed: 6 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -451,10 +451,11 @@ def __init__(self, ax, mappable=None, *, cmap=None,
    451451
    spine.set_visible(False)
    452452
    self.outline = self.ax.spines['outline'] = _ColorbarSpine(self.ax)
    453453
    self._short_axis().set_visible(False)
    454-
    self.patch = mpatches.Polygon(
    454+
    # Only kept for backcompat; remove after deprecation of .patch elapses.
    455+
    self._patch = mpatches.Polygon(
    455 8000 456
    np.empty((0, 2)),
    456457
    color=mpl.rcParams['axes.facecolor'], linewidth=0.01, zorder=-1)
    457-
    ax.add_artist(self.patch)
    458+
    ax.add_artist(self._patch)
    458459

    459460
    self.dividers = collections.LineCollection(
    460461
    [],
    @@ -487,6 +488,9 @@ def __init__(self, ax, mappable=None, *, cmap=None,
    487488
    if isinstance(mappable, contour.ContourSet) and not mappable.filled:
    488489
    self.add_lines(mappable)
    489490

    491+
    # Also remove ._patch after deprecation elapses.
    492+
    patch = _api.deprecate_privatize_attribute("3.5")
    493+
    490494
    def update_normal(self, mappable):
    491495
    """
    492496
    Update solid patches, lines, etc.

    0 commit comments

    Comments
     (0)
    0