How to use the mpld3.display function in mpld3

To help you get started, we’ve selected a few mpld3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github interrogator / corpkit / corpkit / plotter.py View on Github external
#if not interactive and not running_python_tex and not running_spider \
    #    and not tk:
    #    plt.gcf().show()
    #    return plt
    #elif running_spider or tk:
    #    return plt

    if interactive:
        plt.subplots_adjust(right=.8)
        plt.subplots_adjust(left=.1)
        try:
            ax.legend_.remove()
        except:
            pass
        return mpld3.display()
    else:
        return plt
github elbaulp / hugo_similar_posts / similar_posts.py View on Github external
hoffset=10,
                                                 css=css)
        # connect tooltip to fig
        mpld3.plugins.connect(fig, tooltip, TopToolbar())

        # set tick marks as blank
        ax.axes.get_xaxis().set_ticks([])
        ax.axes.get_yaxis().set_ticks([])

        # set axis as blank
        ax.axes.get_xaxis().set_visible(False)
        ax.axes.get_yaxis().set_visible(False)

    ax.legend(numpoints=1)  # show legend with only one dot

    mpld3.display()  # show the plot

    # uncomment the below to export to html
    html = mpld3.fig_to_html(fig)
    name = 'name.%s.html' % ('en' if english else 'es')
    mpld3.save_html(fig, name)
github jcornford / pyecog / pyecog / visualisation / data_explorer.py View on Github external
lines = ax1.plot(x, 0 * x, '-w', lw=1, alpha=0.8)
ax1.set_ylim(-1, 1)

ax1.set_title("Hover over points to see lines")

# transpose line data and add plugin
linedata = data.transpose(0, 2, 1).tolist()


labels = ["Trace {0}".format(i) for i in range(301)]
tooltip = plugins.PointLabelTooltip(points, labels)

plugins.connect(fig,LinkedView(points, lines[0], linedata))
plugins.connect(fig, ClickInfo(points))
#plugins.connect(fig,tooltip)
mpld3.display()
github ttrftech / NanoVNA / python / nanovna.py View on Github external
def smithd3(self, x):
        import mpld3
        import twoport as tp
        fig, ax = pl.subplots()
        sc = tp.SmithChart(show_cursor=True, labels=True, ax=ax)
        sc.plot_s_param(a)
        mpld3.display(fig)