Return a legend handler from *legend_handler_map* that corresponds to *orig_handler*. *legend_handler_map* should be a dictionary object (that is returned by the get_legend_handler_map method). It first checks if the *orig_handle* itself is a key in the
(legend_handler_map, orig_handle)
| 842 | |
| 843 | @staticmethod |
| 844 | def get_legend_handler(legend_handler_map, orig_handle): |
| 845 | """ |
| 846 | Return a legend handler from *legend_handler_map* that |
| 847 | corresponds to *orig_handler*. |
| 848 | |
| 849 | *legend_handler_map* should be a dictionary object (that is |
| 850 | returned by the get_legend_handler_map method). |
| 851 | |
| 852 | It first checks if the *orig_handle* itself is a key in the |
| 853 | *legend_handler_map* and return the associated value. |
| 854 | Otherwise, it checks for each of the classes in its |
| 855 | method-resolution-order. If no matching key is found, it |
| 856 | returns ``None``. |
| 857 | """ |
| 858 | try: |
| 859 | return legend_handler_map[orig_handle] |
| 860 | except (TypeError, KeyError): # TypeError if unhashable. |
| 861 | pass |
| 862 | for handle_type in type(orig_handle).mro(): |
| 863 | try: |
| 864 | return legend_handler_map[handle_type] |
| 865 | except KeyError: |
| 866 | pass |
| 867 | return None |
| 868 | |
| 869 | def _init_legend_box(self, handles, labels, markerfirst=True): |
| 870 | """ |
no outgoing calls
no test coverage detected