Skip to content

Commit dbd157d

Browse files
committed
Rasterize colorbar when it has many colors; closes #4480
1 parent 4884115 commit dbd157d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ def _add_solids(self, X, Y, C):
517517
colors=(mpl.rcParams['axes.edgecolor'],),
518518
linewidths=linewidths)
519519
self.ax.add_collection(self.dividers)
520+
elif len(self._y) > 50:
521+
self.solids.set_rasterized(True)
520522

521523
def add_lines(self, levels, colors, linewidths, erase=True):
522524
'''

0 commit comments

Comments
 (0)