How to use the mpld3.plugins.InteractiveLegendPlugin 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 Patent2net / P2N / Patent2Net / P2N-Cluster.py View on Github external
#    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)
    #next shoul be done at the en of loop for I guess
    #TitFic = ['file:///D:/Doc-David/Developpement/SpyderWorkspace/Git-P2N/DATA/Banana/PatentContents/Metrics/' +Tit2FicName [lab] for lab in labels]
    TitFic = ['file:///'+ Here +Tit2FicName [lab] for lab in labels]
    tempoLab.append(labels)
    tempoFic.append(TitFic)
    
interactive_legend = plugins.InteractiveLegendPlugin( memoFig , memoLab, legend_offset=(0,300),
                                                         alpha_unsel=0.1, alpha_over=0.9, start_visible=False)
interactive_legend2 = plugins.InteractiveLegendPlugin(memoFig2,  memoLab2, legend_offset=(0,0),
                                                          alpha_unsel=0.1, alpha_over=0.8, start_visible=False)
#TitFics = []
#tempoFic=[]

mpld3.plugins.connect(fig,interactive_legend)
mpld3.plugins.connect(fig,interactive_legend2)   

tooltip =dict()
for ligne in fig.get_axes()[0].lines:
        Urls=[]
        labels =[]
        for point in ligne.get_xydata():
            if tuple(point) in MemoPoints.keys():
                Urls.append('file:///'+ Here +Tit2FicName [MemoPoints[tuple(point)]])
github Patent2net / P2N / Patent2Net / P2N-Cluster.py View on Github external
#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)
    #next shoul be done at the en of loop for I guess
    #TitFic = ['file:///D:/Doc-David/Developpement/SpyderWorkspace/Git-P2N/DATA/Banana/PatentContents/Metrics/' +Tit2FicName [lab] for lab in labels]
    TitFic = ['file:///'+ Here +Tit2FicName [lab] for lab in labels]
    tempoLab.append(labels)
    tempoFic.append(TitFic)
    
interactive_legend = plugins.InteractiveLegendPlugin( memoFig , memoLab, legend_offset=(0,300),
                                                         alpha_unsel=0.1, alpha_over=0.9, start_visible=False)
interactive_legend2 = plugins.InteractiveLegendPlugin(memoFig2,  memoLab2, legend_offset=(0,0),
                                                          alpha_unsel=0.1, alpha_over=0.8, start_visible=False)
#TitFics = []
#tempoFic=[]

mpld3.plugins.connect(fig,interactive_legend)
mpld3.plugins.connect(fig,interactive_legend2)   

tooltip =dict()
for ligne in fig.get_axes()[0].lines:
        Urls=[]
        labels =[]
        for point in ligne.get_xydata():
            if tuple(point) in MemoPoints.keys():
                Urls.append('file:///'+ Here +Tit2FicName [MemoPoints[tuple(point)]])
                labels.append(MemoPoints[tuple(point)])
            else:
github tim-fiola / network_traffic_modeler_py3 / examples / graph_network / graph_network_interactive.py View on Github external
ax.text(x, y, text, fontsize=10, color='k', fontname='monospace')

    # Plot the router node labels
    for node in (node for node in json_data['nodes'] if 'midpoint' not in node['id']):

        x, y = node['pos'][1], node['pos'][0]
        if node['failed'] is False:
            text = node['name']
        else:
            text = node['name'] + ' (failed)'
        ax.text(x, y, text, fontsize=15, color='k', fontname='monospace')

    # Create interactive legend
    line_collections, line_group_labels = _create_legend_line_collections(ax)

    interactive_legend = plugins.InteractiveLegendPlugin(line_collections,
                                                         line_group_labels,
                                                         alpha_unsel=0.2,
                                                         alpha_over=1.8,
                                                         start_visible=True)
    fig.subplots_adjust(right=0.85)
    plugins.connect(fig, interactive_legend)

    time_now = str(time.asctime())
    ax.set_title("Network Graph:" + time_now, size=15)

    plot_thread = threading.Thread(target=_run_plot)
    plot_thread.start()