@@ -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,20 @@ 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
- )
769
+ self .set (edgecolor = "none" )
770
+ self .set (** kwargs ) # Let user-set values override defaults.
773
771
774
772
else :
775
773
self .set (
776
774
facecolor = "none" ,
777
775
linewidths = self ._process_linewidths (linewidths ),
778
776
linestyle = self ._process_linestyles (linestyles ),
777
+ label = "_nolegend_" ,
779
778
# Default zorder taken from LineCollection, which is higher
780
779
# than for filled contours so that lines are displayed on top.
781
- zorder = kwargs .pop ("zorder" , 2 ),
782
- label = "_nolegend_" ,
780
+ zorder = 2 ,
783
781
)
782
+ self .set (** kwargs )
784
783
785
784
self .axes .add_collection (self , autolim = False )
786
785
self .sticky_edges .x [:] = [self ._mins [0 ], self ._maxs [0 ]]
@@ -790,12 +789,6 @@ def __init__(self, ax, *args,
790
789
791
790
self .changed () # set the colors
792
791
793
- if kwargs :
794
- _api .warn_external (
795
- 'The following kwargs were not used by contour: ' +
796
- ", " .join (map (repr , kwargs ))
797
- )
798
-
799
792
allsegs = property (lambda self : [
800
793
[subp .vertices for subp in p ._iter_connected_components ()]
801
794
for p in self .get_paths ()])
0 commit comments