Exemple #1
0
 def create_artists(self, legend, orig_handle,
                    xdescent, ydescent, width, height, fontsize,
                    trans):
     #from matplotlib.collections import LineCollection
     
     #  call the parent class function
     artists = HandlerErrorbar.create_artists(self, legend, orig_handle,
                                              xdescent, ydescent, 
                                              width, height, fontsize,
                                              trans)
     
     #Identify the artists. just so we know what each is
     #NOTE: The order here is different to that in ErrorbarContainer, so we re-order
     barlinecols, rest = partition(is_line, artists)
     barlinecols = tuple(barlinecols)
     *caplines, legline, legline_marker = rest
     
     xerr_size, yerr_size = self.get_err_size(legend, xdescent, ydescent,
                                              width, height, fontsize)       #NOTE: second time calling this (already done in HandlerErrorbar.create_artists
     
     legline_marker.set_pickradius( xerr_size*1.25 )
     legline_marker.set_picker( ErrorbarPicker() )
     
     return [legline_marker, caplines, barlinecols, legline]
Exemple #2
0
 def _partition(artists):
     ''' '''
     stems, rest = partition(is_line, artists)
     markers, *caps = rest
     return markers, caps, tuple(stems)