def svg_html_from_pyplot_figure(fig: "Figure") -> str:
    """
    Converts a ``pyplot`` figure to an SVG tag.
    """
    if fig is None:
        return ""
    memfile = io.BytesIO()  # StringIO doesn't like mixing str/unicode
    fig.savefig(memfile, format="svg")
    return memfile.getvalue().decode("utf-8")