def get_color_from_artist(artist: Artist): if isinstance(artist, ErrorbarContainer): return artist[0].get_color() else: return artist.get_color()