Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48f594c

Browse files
committed
changed colorbar outline from a Line2D object to a Polygon object
fixes issue #2296
1 parent 88f8b8f commit 48f594c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/colorbar.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import matplotlib.contour as contour
3232
import matplotlib.cm as cm
3333
import matplotlib.gridspec as gridspec
34-
import matplotlib.lines as lines
3534
import matplotlib.patches as mpatches
3635
import matplotlib.path as mpath
3736
import matplotlib.ticker as ticker
@@ -415,9 +414,11 @@ def _config_axes(self, X, Y):
415414
ax.set_ylim(*ax.dataLim.intervaly)
416415
if self.outline is not None:
417416
self.outline.remove()
418-
self.outline = lines.Line2D(
419-
xy[:, 0], xy[:, 1], color=mpl.rcParams['axes.edgecolor'],
420-
linewidth=mpl.rcParams['axes.linewidth'])
417+
self.outline = mpatches.Polygon(
418+
xy, edgecolor=mpl.rcParams['axes.edgecolor'],
419+
facecolor='none',
420+
linewidth=mpl.rcParams['axes.linewidth'],
421+
closed=True)
421422
ax.add_artist(self.outline)
422423
self.outline.set_clip_box(None)
423424
self.outline.set_clip_path(None)

0 commit comments

Comments
 (0)