mkt.databases.conservation._HandlerRoundedBox
- class mkt.databases.conservation._HandlerRoundedBox(patch_func=None, **kwargs)[source]
Bases:
HandlerPatchLegend handler that renders a
Patchhandle as a rounded box (matching the dot-plot clade enclosures) rather than a sharp rectangle.- __init__(patch_func=None, **kwargs)
- Parameters:
patch_func (callable, optional) – The function that creates the legend key artist. patch_func should have the signature:
def patch_func(legend=legend, orig_handle=orig_handle, xdescent=xdescent, ydescent=ydescent, width=width, height=height, fontsize=fontsize)
Subsequently, the created artist will have its
update_propmethod called and the appropriate transform will be applied.**kwargs – Keyword arguments forwarded to .HandlerBase.
Methods
__eq__(value, /)Return self==value.
__init__([patch_func])_create_patch(legend, orig_handle, xdescent, ...)_default_update_prop(legend_handle, orig_handle)_update_prop(legend_handle, orig_handle)adjust_drawing_area(legend, orig_handle, ...)create_artists(legend, orig_handle, ...)Return the legend artists generated.
legend_artist(legend, orig_handle, fontsize, ...)Return the artist that this HandlerBase generates for the given original artist/handle.
update_prop(legend_handle, orig_handle, legend)- create_artists(legend, orig_handle, xdescent, ydescent, width, height, fontsize, trans)[source]
Return the legend artists generated.
- Parameters:
legend (~matplotlib.legend.Legend) – The legend for which these legend artists are being created.
orig_handle (~matplotlib.artist.Artist or similar) – The object for which these legend artists are being created.
xdescent, ydescent, width, height (int) – The rectangle (xdescent, ydescent, width, height) that the legend artists being created should fit within.
fontsize (int) – The fontsize in pixels. The legend artists being created should be scaled according to the given fontsize.
trans (~matplotlib.transforms.Transform) – The transform that is applied to the legend artists being created. Typically from unit coordinates in the handler box to screen coordinates.