def send_svg_figure(fig):
    """Draw the current figure and send it as an SVG payload.
    """
    # For an empty figure, don't even bother calling figure_to_svg, to avoid
    # big blank spaces in the qt console
    if not fig.axes:
        return

    svg = figure_to_svg(fig)
    # flush text streams before sending figures, helps a little with output
    # synchronization in the console (though it's a bandaid, not a real sln)
    sys.stdout.flush()
    sys.stderr.flush()
    publish_display_data('IPython.zmq.pylab.backend_inline.send_svg_figure',
                         'Matplotlib Plot', {'image/svg+xml': svg})
Exemple #2
0
def send_svg_figure(fig):
    """Draw the current figure and send it as an SVG payload.
    """
    # For an empty figure, don't even bother calling figure_to_svg, to avoid
    # big blank spaces in the qt console
    if not fig.axes:
        return

    svg = figure_to_svg(fig)
    # flush text streams before sending figures, helps a little with output
    # synchronization in the console (though it's a bandaid, not a real sln)
    sys.stdout.flush(); sys.stderr.flush()
    publish_display_data(
        'IPython.zmq.pylab.backend_inline.send_svg_figure',
        'Matplotlib Plot',
        {'image/svg+xml' : svg}
    )
Exemple #3
0
def send_svg_figure(fig):
    """Draw the current figure and send it as an SVG payload.
    """
    svg = figure_to_svg(fig)
    publish_display_data("IPython.zmq.pylab.backend_inline.send_svg_figure", "Matplotlib Plot", {"image/svg+xml": svg})
Exemple #4
0
def send_svg_figure(fig):
    """Draw the current figure and send it as an SVG payload.
    """
    svg = figure_to_svg(fig)
    publish_display_data('IPython.zmq.pylab.backend_inline.send_svg_figure',
                         'Matplotlib Plot', {'image/svg+xml': svg})