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, it then goes into ipython mode:
>>> import cufflinks as cf
>>> cf.set_config_file(offline=True)
In :
Subsequently, when I try and generate a plot, nothing appears:
In : df.iplot(kind='bar', barmode='stack', filename='cufflinks/test')
In :
Can cufflinks be used offline without a plotly account?
Installing and running plotlib and cufflinksFirst, we install these two libraries using the pip command. After installing, we import all necessary modules in our python shell or jupyter notebook. For enabling the offline mode for plotting locally in the jupyter notebook we write the below code.
Use the . iplot() method with arguments kind (plot type), x (x-axis variable), y (y-axis variable), and mode argument removes the line connections setup by default with plotly. The plot can be zoomed in or out depending on need.
@elsherbini and @Charon: unfortunately I have not enough credentials to comment, so I have to write a new answer. your code pointed me into the right direction, but with the latest cufflinks version it goes even simpler:
import cufflinks as cf
df.iplot(kind='bar', barmode='stack', filename="my_barplot" , asPlot=True)
This code will generate a my_barplot.html file and open the plot in the default web browser. And this code is scriptable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With