@@ -2040,6 +2040,7 @@ def cycle_changer(
20402040 label = None , labels = None , values = None ,
20412041 legend = None , legend_kw = None ,
20422042 colorbar = None , colorbar_kw = None ,
2043+ errobjs = None ,
20432044 ** kwargs
20442045):
20452046 """
@@ -2088,6 +2089,9 @@ def cycle_changer(
20882089 colorbar_kw : dict-like, optional
20892090 Ignored if `colorbar` is ``None``. Extra keyword args for our call
20902091 to `~proplot.axes.Axes.colorbar`.
2092+ errobjs : `~matplotlib.artist.Artist` or list thereof, optional
2093+ Error bar objects to add to the legend. This is used internally and
2094+ should not be necessary for users. See `indicate_error`.
20912095
20922096 Other parameters
20932097 ----------------
@@ -2318,11 +2322,14 @@ def cycle_changer(
23182322
23192323 # Add legend
23202324 if legend :
2321- # Add handles
2325+ # Add handles and error objects
23222326 loc = self ._loc_translate (legend , 'legend' , allow_manual = False )
23232327 if loc not in self ._auto_legend :
23242328 self ._auto_legend [loc ] = ([], {})
23252329 self ._auto_legend [loc ][0 ].extend (objs )
2330+ if type (errobjs ) not in (list , tuple ):
2331+ errobjs = (errobjs ,)
2332+ self ._auto_legend [loc ][0 ].extend (obj for obj in errobjs if obj is not None )
23262333 # Add keywords
23272334 if loc != 'fill' :
23282335 legend_kw .setdefault ('loc' , loc )
0 commit comments