Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 92a3fc4

Browse filesBrowse 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
Copy full SHA for 92a3fc4

File tree

Expand file treeCollapse file tree

2 files changed

+11
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-2
lines changed

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

Copy file name to clipboardExpand all lines: doc/api/next_api_changes/behavior/20054-JMK.rst
+5Lines changed: 5 additions & 0 deletions
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

Copy file name to clipboardExpand all lines: lib/matplotlib/colorbar.py
+6-2Lines 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(
455456
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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.