Cufflinks for plotly: setting cufflinks config options launches

前端 未结 5 1708
太阳男子
太阳男子 2021-01-05 06:02

I\'m trying to use cufflinks locally to generate plotly graphs from a pandas Dataframe

However, when I try and configure cufflinks in a python console,

5条回答
  •  猫巷女王i
    2021-01-05 06:25

    This worked for me (assuming you have a folder name cufflinks):

    import plotly.plotly as py
    import plotly
    import cufflinks as cf
    import pandas as pd
    import numpy as np
    from plotly.offline import download_plotlyjs, init_notebook_mode, 
    plot, iplot
    init_notebook_mode(connected=True)
    cf.go_offline()
    
    
    # Offline html saving
    df = pd.DataFrame(np.random.randn(1000, 3), columns=['A','B','C']).cumsum()
    fig = df.iplot(asFigure=True)
    plotly.offline.plot(fig,filename="cufflinks/example.html")
    

提交回复
热议问题