88they are meant to be fast for common use cases (e.g., a large set of solid
99line segemnts)
1010"""
11- from __future__ import (absolute_import , division , print_function ,
12- unicode_literals )
11+ from __future__ import absolute_import , division , print_function
1312
1413import warnings
1514
3130CIRCLE_AREA_FACTOR = 1.0 / np .sqrt (np .pi )
3231
3332
34- _color_aliases = {'facecolors' : ['facecolor' ],
35- 'edgecolors' : ['edgecolor' ]}
36-
37-
33+ @cbook ._define_aliases ({
34+ "antialiased" : ["antialiaseds" ],
35+ "edgecolor" : ["edgecolors" ],
36+ "facecolor" : ["facecolors" ],
37+ "linestyle" : ["linestyles" , "dashes" ],
38+ "linewidth" : ["linewidths" , "lw" ],
39+ })
3840class Collection (artist .Artist , cm .ScalarMappable ):
3941 """
4042 Base class for Collections. Must be subclassed to be usable.
@@ -507,14 +509,6 @@ def set_linewidth(self, lw):
507509 self ._us_lw , self ._us_linestyles )
508510 self .stale = True
509511
510- def set_linewidths (self , lw ):
511- """alias for set_linewidth"""
512- return self .set_linewidth (lw )
513-
514- def set_lw (self , lw ):
515- """alias for set_linewidth"""
516- return self .set_linewidth (lw )
517-
518512 def set_linestyle (self , ls ):
519513 """
520514 Set the linestyle(s) for the collection.
@@ -642,14 +636,6 @@ def _bcast_lwls(linewidths, dashes):
642636
643637 return linewidths , dashes
644638
645- def set_linestyles (self , ls ):
646- """alias for set_linestyle"""
647- return self .set_linestyle (ls )
648-
649- def set_dashes (self , ls ):
650- """alias for set_linestyle"""
651- return self .set_linestyle (ls )
652-
653639 def set_antialiased (self , aa ):
654640 """
655641 Set the antialiasing state for rendering.
@@ -661,10 +647,6 @@ def set_antialiased(self, aa):
661647 self ._antialiaseds = np .atleast_1d (np .asarray (aa , bool ))
662648 self .stale = True
663649
664- def set_antialiaseds (self , aa ):
665- """alias for set_antialiased"""
666- return self .set_antialiased (aa )
667-
668650 def set_color (self , c ):
669651 """
670652 Set both the edgecolor and the facecolor.
@@ -706,21 +688,15 @@ def set_facecolor(self, c):
706688 self ._original_facecolor = c
707689 self ._set_facecolor (c )
708690
709- def set_facecolors (self , c ):
710- """alias for set_facecolor"""
711- return self .set_facecolor (c )
712-
713691 def get_facecolor (self ):
714692 return self ._facecolors
715- get_facecolors = get_facecolor
716693
717694 def get_edgecolor (self ):
718695 if (isinstance (self ._edgecolors , six .string_types )
719696 and self ._edgecolors == str ('face' )):
720697 return self .get_facecolors ()
721698 else :
722699 return self ._edgecolors
723- get_edgecolors = get_edgecolor
724700
725701 def _set_edgecolor (self , c ):
726702 set_hatch_color = True
@@ -766,10 +742,6 @@ def set_edgecolor(self, c):
766742 self ._original_edgecolor = c
767743 self ._set_edgecolor (c )
768744
769- def set_edgecolors (self , c ):
770- """alias for set_edgecolor"""
771- return self .set_edgecolor (c )
772-
773745 def set_alpha (self , alpha ):
774746 """
775747 Set the alpha tranparencies of the collection. *alpha* must be
@@ -787,13 +759,11 @@ def set_alpha(self, alpha):
787759 self ._set_facecolor (self ._original_facecolor )
788760 self ._set_edgecolor (self ._original_edgecolor )
789761
790- def get_linewidths (self ):
762+ def get_linewidth (self ):
791763 return self ._linewidths
792- get_linewidth = get_linewidths
793764
794- def get_linestyles (self ):
765+ def get_linestyle (self ):
795766 return self ._linestyles
796- get_dashes = get_linestyle = get_linestyles
797767
798768 def update_scalarmappable (self ):
799769 """
@@ -838,6 +808,7 @@ def update_from(self, other):
838808 # self.update_dict = other.update_dict # do we need to copy this? -JJL
839809 self .stale = True
840810
811+
841812# these are not available for the object inspector until after the
842813# class is built so we define an initial set here for the init
843814# function and they will be overridden after object defn
@@ -1558,17 +1529,11 @@ def set_lineoffset(self, lineoffset):
15581529 self ._lineoffset = lineoffset
15591530
15601531 def get_linewidth (self ):
1561- '''
1562- get the width of the lines used to mark each event
1563- '''
1564- return self .get_linewidths ()[0 ]
1532+ """Get the width of the lines used to mark each event."""
1533+ return super (EventCollection , self ).get_linewidth ()[0 ]
15651534
1566- def get_linestyle (self ):
1567- '''
1568- get the style of the lines used to mark each event
1569- [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
1570- '''
1571- return self .get_linestyles ()
1535+ def get_linewidths (self ):
1536+ return super (EventCollection , self ).get_linewidth ()
15721537
15731538 def get_color (self ):
15741539 '''
0 commit comments