(self, legend_handle, orig_handle)
| 775 | `~.Axes.stackplot`. |
| 776 | """ |
| 777 | def _update_prop(self, legend_handle, orig_handle): |
| 778 | def first_color(colors): |
| 779 | if colors.size == 0: |
| 780 | return (0, 0, 0, 0) |
| 781 | return tuple(colors[0]) |
| 782 | |
| 783 | def get_first(prop_array): |
| 784 | if len(prop_array): |
| 785 | return prop_array[0] |
| 786 | else: |
| 787 | return None |
| 788 | |
| 789 | # orig_handle is a PolyCollection and legend_handle is a Patch. |
| 790 | # Directly set Patch color attributes (must be RGBA tuples). |
| 791 | legend_handle._facecolor = first_color(orig_handle.get_facecolor()) |
| 792 | legend_handle._edgecolor = first_color(orig_handle.get_edgecolor()) |
| 793 | legend_handle._hatch_color = first_color(orig_handle.get_hatchcolor()) |
| 794 | legend_handle._original_facecolor = orig_handle._original_facecolor |
| 795 | legend_handle._original_edgecolor = orig_handle._original_edgecolor |
| 796 | legend_handle._fill = orig_handle.get_fill() |
| 797 | legend_handle._hatch = orig_handle.get_hatch() |
| 798 | # Setters are fine for the remaining attributes. |
| 799 | legend_handle.set_linewidth(get_first(orig_handle.get_linewidths())) |
| 800 | legend_handle.set_linestyle(get_first(orig_handle.get_linestyles())) |
| 801 | legend_handle.set_transform(get_first(orig_handle.get_transforms())) |
| 802 | # Alpha is already taken into account by the color attributes. |
| 803 | |
| 804 | def create_artists(self, legend, orig_handle, |
| 805 | xdescent, ydescent, width, height, fontsize, trans): |
nothing calls this directly
no test coverage detected