@@ -156,12 +156,12 @@ def __init__(self, *,
156
156
cm .ScalarMappable .__init__ (self , norm , cmap )
157
157
# list of un-scaled dash patterns
158
158
# this is needed scaling the dash pattern by linewidth
159
- self ._us_linestyles = [(0 , None )]
159
+ self ._us_linestyle = [(0 , None )]
160
160
# list of dash patterns
161
- self ._linestyles = [(0 , None )]
161
+ self ._linestyle = [(0 , None )]
162
162
# list of unbroadcast/scaled linewidths
163
163
self ._us_lw = [0 ]
164
- self ._linewidths = [0 ]
164
+ self ._linewidth = [0 ]
165
165
166
166
self ._gapcolor = None # Currently only used by LineCollection.
167
167
@@ -380,9 +380,9 @@ def draw(self, renderer):
380
380
do_single_path_optimization = False
381
381
if (len (paths ) == 1 and len (trans ) <= 1 and
382
382
len (facecolors ) == 1 and len (edgecolors ) == 1 and
383
- len (self ._linewidths ) == 1 and
384
- all (ls [1 ] is None for ls in self ._linestyles ) and
385
- len (self ._antialiaseds ) == 1 and len (self ._urls ) == 1 and
383
+ len (self ._linewidth ) == 1 and
384
+ all (ls [1 ] is None for ls in self ._linestyle ) and
385
+ len (self ._antialiased ) == 1 and len (self ._urls ) == 1 and
386
386
self .get_hatch () is None ):
387
387
if len (trans ):
388
388
combined_transform = transforms .Affine2D (trans [0 ]) + transform
@@ -401,31 +401,31 @@ def draw(self, renderer):
401
401
402
402
if do_single_path_optimization :
403
403
gc .set_foreground (tuple (edgecolors [0 ]))
404
- gc .set_linewidth (self ._linewidths [0 ])
405
- gc .set_dashes (* self ._linestyles [0 ])
406
- gc .set_antialiased (self ._antialiaseds [0 ])
404
+ gc .set_linewidth (self ._linewidth [0 ])
405
+ gc .set_dashes (* self ._linestyle [0 ])
406
+ gc .set_antialiased (self ._antialiased [0 ])
407
407
gc .set_url (self ._urls [0 ])
408
408
renderer .draw_markers (
409
409
gc , paths [0 ], combined_transform .frozen (),
410
410
mpath .Path (offsets ), offset_trf , tuple (facecolors [0 ]))
411
411
else :
412
412
if self ._gapcolor is not None :
413
413
# First draw paths within the gaps.
414
- ipaths , ilinestyles = self ._get_inverse_paths_linestyles ()
414
+ ipaths , ilinestyles = self ._get_inverse_paths_linestyle ()
415
415
renderer .draw_path_collection (
416
416
gc , transform .frozen (), ipaths ,
417
417
self .get_transforms (), offsets , offset_trf ,
418
418
[mcolors .to_rgba ("none" )], self ._gapcolor ,
419
- self ._linewidths , ilinestyles ,
420
- self ._antialiaseds , self ._urls ,
419
+ self ._linewidth , ilinestyles ,
420
+ self ._antialiased , self ._urls ,
421
421
"screen" )
422
422
423
423
renderer .draw_path_collection (
424
424
gc , transform .frozen (), paths ,
425
425
self .get_transforms (), offsets , offset_trf ,
426
426
self .get_facecolor (), self .get_edgecolor (),
427
- self ._linewidths , self ._linestyles ,
428
- self ._antialiaseds , self ._urls ,
427
+ self ._linewidth , self ._linestyle ,
428
+ self ._antialiased , self ._urls ,
429
429
"screen" ) # offset_position, kept for backcompat.
430
430
431
431
gc .restore ()
@@ -584,8 +584,8 @@ def set_linewidth(self, lw):
584
584
self ._us_lw = np .atleast_1d (lw )
585
585
586
586
# scale all of the dash patterns.
587
- self ._linewidths , self ._linestyles = self ._bcast_lwls (
588
- self ._us_lw , self ._us_linestyles )
587
+ self ._linewidth , self ._linestyle = self ._bcast_lwls (
588
+ self ._us_lw , self ._us_linestyle )
589
589
self .stale = True
590
590
591
591
def set_linestyle (self , ls ):
@@ -624,11 +624,11 @@ def set_linestyle(self, ls):
624
624
raise ValueError (emsg ) from err
625
625
626
626
# get the list of raw 'unscaled' dash patterns
627
- self ._us_linestyles = dashes
627
+ self ._us_linestyle = dashes
628
628
629
629
# broadcast and scale the lw and dash patterns
630
- self ._linewidths , self ._linestyles = self ._bcast_lwls (
631
- self ._us_lw , self ._us_linestyles )
630
+ self ._linewidth , self ._linestyle = self ._bcast_lwls (
631
+ self ._us_lw , self ._us_linestyle )
632
632
633
633
@_docstring .interpd
634
634
def set_capstyle (self , cs ):
@@ -732,7 +732,7 @@ def set_antialiased(self, aa):
732
732
"""
733
733
if aa is None :
734
734
aa = self ._get_default_antialiased ()
735
- self ._antialiaseds = np .atleast_1d (np .asarray (aa , bool ))
735
+ self ._antialiased = np .atleast_1d (np .asarray (aa , bool ))
736
736
self .stale = True
737
737
738
738
def _get_default_antialiased (self ):
@@ -763,7 +763,7 @@ def _set_facecolor(self, c):
763
763
if c is None :
764
764
c = self ._get_default_facecolor ()
765
765
766
- self ._facecolors = mcolors .to_rgba_array (c , self ._alpha )
766
+ self ._facecolor = mcolors .to_rgba_array (c , self ._alpha )
767
767
self .stale = True
768
768
769
769
def set_facecolor (self , c ):
@@ -784,13 +784,13 @@ def set_facecolor(self, c):
784
784
self ._set_facecolor (c )
785
785
786
786
def get_facecolor (self ):
787
- return self ._facecolors
787
+ return self ._facecolor
788
788
789
789
def get_edgecolor (self ):
790
- if cbook ._str_equal (self ._edgecolors , 'face' ):
790
+ if cbook ._str_equal (self ._edgecolor , 'face' ):
791
791
return self .get_facecolor ()
792
792
else :
793
- return self ._edgecolors
793
+ return self ._edgecolor
794
794
795
795
def _get_default_edgecolor (self ):
796
796
# This may be overridden in a subclass.
@@ -807,12 +807,12 @@ def _set_edgecolor(self, c):
807
807
c = 'none'
808
808
set_hatch_color = False
809
809
if cbook ._str_lower_equal (c , 'face' ):
810
- self ._edgecolors = 'face'
810
+ self ._edgecolor = 'face'
811
811
self .stale = True
812
812
return
813
- self ._edgecolors = mcolors .to_rgba_array (c , self ._alpha )
814
- if set_hatch_color and len (self ._edgecolors ):
815
- self ._hatch_color = tuple (self ._edgecolors [0 ])
813
+ self ._edgecolor = mcolors .to_rgba_array (c , self ._alpha )
814
+ if set_hatch_color and len (self ._edgecolor ):
815
+ self ._hatch_color = tuple (self ._edgecolor [0 ])
816
816
self .stale = True
817
817
818
818
def set_edgecolor (self , c ):
@@ -852,10 +852,10 @@ def set_alpha(self, alpha):
852
852
set_alpha .__doc__ = artist .Artist ._set_alpha_for_array .__doc__
853
853
854
854
def get_linewidth (self ):
855
- return self ._linewidths
855
+ return self ._linewidth
856
856
857
857
def get_linestyle (self ):
858
- return self ._linestyles
858
+ return self ._linestyle
859
859
860
860
def _set_mappable_flags (self ):
861
861
"""
@@ -920,11 +920,11 @@ def update_scalarmappable(self):
920
920
self ._mapped_colors = self .to_rgba (self ._A , self ._alpha )
921
921
922
922
if self ._face_is_mapped :
923
- self ._facecolors = self ._mapped_colors
923
+ self ._facecolor = self ._mapped_colors
924
924
else :
925
925
self ._set_facecolor (self ._original_facecolor )
926
926
if self ._edge_is_mapped :
927
- self ._edgecolors = self ._mapped_colors
927
+ self ._edgecolor = self ._mapped_colors
928
928
else :
929
929
self ._set_edgecolor (self ._original_edgecolor )
930
930
self .stale = True
@@ -937,17 +937,17 @@ def update_from(self, other):
937
937
"""Copy properties from other to self."""
938
938
939
939
artist .Artist .update_from (self , other )
940
- self ._antialiaseds = other ._antialiaseds
940
+ self ._antialiased = other ._antialiased
941
941
self ._mapped_colors = other ._mapped_colors
942
942
self ._edge_is_mapped = other ._edge_is_mapped
943
943
self ._original_edgecolor = other ._original_edgecolor
944
- self ._edgecolors = other ._edgecolors
944
+ self ._edgecolor = other ._edgecolor
945
945
self ._face_is_mapped = other ._face_is_mapped
946
946
self ._original_facecolor = other ._original_facecolor
947
- self ._facecolors = other ._facecolors
948
- self ._linewidths = other ._linewidths
949
- self ._linestyles = other ._linestyles
950
- self ._us_linestyles = other ._us_linestyles
947
+ self ._facecolor = other ._facecolor
948
+ self ._linewidth = other ._linewidth
949
+ self ._linestyle = other ._linestyle
950
+ self ._us_linestyle = other ._us_linestyle
951
951
self ._pickradius = other ._pickradius
952
952
self ._hatch = other ._hatch
953
953
@@ -1465,7 +1465,7 @@ def set_color(self, c):
1465
1465
set_colors = set_color
1466
1466
1467
1467
def get_color (self ):
1468
- return self ._edgecolors
1468
+ return self ._edgecolor
1469
1469
1470
1470
get_colors = get_color # for compatibility with old versions
1471
1471
@@ -1499,7 +1499,7 @@ def _set_gapcolor(self, gapcolor):
1499
1499
def get_gapcolor (self ):
1500
1500
return self ._gapcolor
1501
1501
1502
- def _get_inverse_paths_linestyles (self ):
1502
+ def _get_inverse_paths_linestyle (self ):
1503
1503
"""
1504
1504
Returns the path and pattern for the gaps in the non-solid lines.
1505
1505
@@ -1512,7 +1512,7 @@ def _get_inverse_paths_linestyles(self):
1512
1512
if ls == (0 , None ) else
1513
1513
(path , mlines ._get_inverse_dash_pattern (* ls ))
1514
1514
for (path , ls ) in
1515
- zip (self ._paths , itertools .cycle (self ._linestyles ))]
1515
+ zip (self ._paths , itertools .cycle (self ._linestyle ))]
1516
1516
1517
1517
return zip (* path_patterns )
1518
1518
@@ -1914,7 +1914,7 @@ def draw(self, renderer):
1914
1914
verts = np .stack ((tri .x [triangles ], tri .y [triangles ]), axis = - 1 )
1915
1915
1916
1916
self .update_scalarmappable ()
1917
- colors = self ._facecolors [triangles ]
1917
+ colors = self ._facecolor [triangles ]
1918
1918
1919
1919
gc = renderer .new_gc ()
1920
1920
self ._set_gc_clip (gc )
@@ -2179,7 +2179,7 @@ def draw(self, renderer):
2179
2179
coordinates , offsets , offset_trf ,
2180
2180
# Backends expect flattened rgba arrays (n*m, 4) for fc and ec
2181
2181
self .get_facecolor ().reshape ((- 1 , 4 )),
2182
- self ._antialiased , self .get_edgecolors ().reshape ((- 1 , 4 )))
2182
+ self ._antialiased , self .get_edgecolor ().reshape ((- 1 , 4 )))
2183
2183
gc .restore ()
2184
2184
renderer .close_group (self .__class__ .__name__ )
2185
2185
self .stale = False
0 commit comments