@@ -602,7 +602,7 @@ def __init__(self, ax, *args,
602602 hatches = (None ,), alpha = None , origin = None , extent = None ,
603603 cmap = None , colors = None , norm = None , vmin = None , vmax = None ,
604604 colorizer = None , extend = 'neither' , antialiased = None , nchunk = 0 ,
605- locator = None , transform = None , negative_linestyles = None , clip_path = None ,
605+ locator = None , transform = None , negative_linestyles = None ,
606606 ** kwargs ):
607607 """
608608 Draw contour lines or filled regions, depending on
@@ -656,7 +656,6 @@ def __init__(self, ax, *args,
656656 super ().__init__ (
657657 antialiaseds = antialiased ,
658658 alpha = alpha ,
659- clip_path = clip_path ,
660659 transform = transform ,
661660 colorizer = colorizer ,
662661 )
@@ -672,6 +671,9 @@ def __init__(self, ax, *args,
672671 self .nchunk = nchunk
673672 self .locator = locator
674673
674+ if "color" in kwargs :
675+ raise _api .kwarg_error ("ContourSet.__init__" , "color" )
676+
675677 if colorizer :
676678 self ._set_colorizer_check_keywords (colorizer , cmap = cmap ,
677679 norm = norm , vmin = vmin ,
@@ -764,23 +766,18 @@ def __init__(self, ax, *args,
764766 _api .warn_external ('linewidths is ignored by contourf' )
765767 # Lower and upper contour levels.
766768 lowers , uppers = self ._get_lowers_and_uppers ()
767- self .set (
768- edgecolor = "none" ,
769- # Default zorder taken from Collection
770- zorder = kwargs .pop ("zorder" , 1 ),
771- rasterized = kwargs .pop ("rasterized" , False ),
772- )
773-
769+ self .set (edgecolor = "none" )
774770 else :
775771 self .set (
776772 facecolor = "none" ,
777773 linewidths = self ._process_linewidths (linewidths ),
778774 linestyle = self ._process_linestyles (linestyles ),
775+ label = "_nolegend_" ,
779776 # Default zorder taken from LineCollection, which is higher
780777 # than for filled contours so that lines are displayed on top.
781- zorder = kwargs .pop ("zorder" , 2 ),
782- label = "_nolegend_" ,
778+ zorder = 2 ,
783779 )
780+ self .set (** kwargs ) # Let user-set values override defaults.
784781
785782 self .axes .add_collection (self , autolim = False )
786783 self .sticky_edges .x [:] = [self ._mins [0 ], self ._maxs [0 ]]
@@ -790,12 +787,6 @@ def __init__(self, ax, *args,
790787
791788 self .changed () # set the colors
792789
793- if kwargs :
794- _api .warn_external (
795- 'The following kwargs were not used by contour: ' +
796- ", " .join (map (repr , kwargs ))
797- )
798-
799790 allsegs = property (lambda self : [
800791 [subp .vertices for subp in p ._iter_connected_components ()]
801792 for p in self .get_paths ()])
0 commit comments