简体   繁体   中英

plotly can't seem to create my interactive plot in pycharm

I'm trying to use plotly and cufflinks for python in pycharm. I use iplot but it's just not working. Does anyone knows why?

Thanks in advance!

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from plotly.offline import download_plotlyjs, plot, iplot
import cufflinks as cf


df=pd.DataFrame(np.random.randn(100, 4), columns=['a','b','c','d'])

df2=pd.DataFrame({'cate':['a', 'b', 'c'],'values':[53, 67, 22]})

df.iplot()

Use fig.show() :

import numpy as np
import pandas as pd
import cufflinks as cf

df = pd.DataFrame(np.random.randn(100, 4), columns=['a','b','c','d'])

fig = df.iplot(asFigure =True,
               xTitle = "The X Axis",
               yTitle = "The Y Axis",
               title = "The Figure Title")
fig.show()

and you get:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM