Execute the following code to plot Microsoft's stock prices together with the simple and log returns.
- Import the libraries and handle the settings:
import cufflinks as cffrom plotly.offline import iplot, init_notebook_mode# set up configuration (run it once)#cf.set_config_file(world_readable=True, theme='pearl', # offline=True)init_notebook_mode()
- Create the plot:
df.iplot(subplots=True, shape=(3,1), shared_xaxes=True, title='MSFT time series')
We can observe the time series in the following plot:
The main advantage of using plotly with cufflinks is the interactivity of the preceding chart, which is unfortunately ...