@@ -602,7 +602,7 @@ def __init__(self, ax, *args,
602
602
hatches = (None ,), alpha = None , origin = None , extent = None ,
603
603
cmap = None , colors = None , norm = None , vmin = None , vmax = None ,
604
604
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 ,
606
606
** kwargs ):
607
607
"""
608
608
Draw contour lines or filled regions, depending on
@@ -656,7 +656,6 @@ def __init__(self, ax, *args,
656
656
super ().__init__ (
657
657
antialiaseds = antialiased ,
658
658
alpha = alpha ,
659
- clip_path = clip_path ,
660
659
transform = transform ,
661
660
colorizer = colorizer ,
662
661
)
@@ -672,6 +671,9 @@ def __init__(self, ax, *args,
672
671
self .nchunk = nchunk
673
672
self .locator = locator
674
673
674
+ if "color" in kwargs :
675
+ raise _api .kwarg_error ("ContourSet.__init__" , "color" )
676
+
675
677
if colorizer :
676
678
self ._set_colorizer_check_keywords (colorizer , cmap = cmap ,
677
679
norm = norm , vmin = vmin ,
@@ -764,23 +766,18 @@ def __init__(self, ax, *args,
764
766
_api .warn_external ('linewidths is ignored by contourf' )
765
767
# Lower and upper contour levels.
766
768
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" )
774
770
else :
775
771
self .set (
776
772
facecolor = "none" ,
777
773
linewidths = self ._process_linewidths (linewidths ),
778
774
linestyle = self ._process_linestyles (linestyles ),
775
+ label = "_nolegend_" ,
779
776
# Default zorder taken from LineCollection, which is higher
780
777
# than for filled contours so that lines are displayed on top.
781
- zorder = kwargs .pop ("zorder" , 2 ),
782
- label = "_nolegend_" ,
778
+ zorder = 2 ,
783
779
)
780
+ self .set (** kwargs ) # Let user-set values override defaults.
784
781
785
782
self .axes .add_collection (self , autolim = False )
786
783
self .sticky_edges .x [:] = [self ._mins [0 ], self ._maxs [0 ]]
@@ -790,12 +787,6 @@ def __init__(self, ax, *args,
790
787
791
788
self .changed () # set the colors
792
789
793
- if kwargs :
794
- _api .warn_external (
795
- 'The following kwargs were not used by contour: ' +
796
- ", " .join (map (repr , kwargs ))
797
- )
798
-
799
790
allsegs = property (lambda self : [
800
791
[subp .vertices for subp in p ._iter_connected_components ()]
801
792
for p in self .get_paths ()])
0 commit comments