I followed a tutorial to do forecasting, who uses Matplotlib , but I don’t like it. I mean, I found more beautiful Plotly, because you can interact with graphics . So, I looked the documentation to convert Matplotlib to Plotly, but I don’t how can I do it and if I can do it, as I don’t have the data using the Matplotlib functions (plot_pacf, plot_acf, autocorrelation_plot and lag_plot) . I would like to ask if someone have any idea how to do it. I checked on Github the code of those functions, but nothing.
I am having the same problem as @zero94. I would like to use plotly to plot acf and pacf. I already tried to convert the plots generated by pandas library to plotly (I followed the instructions in the documentation as well), but I got three different warnings:
“Blended transforms not yet supported. Zoom behavior may not work as expected.”
“Bummer! Plotly can currently only draw Line2D objects from matplotlib that are in ‘data’ coordinates!”
“Dang! That path collection is out of this world. I totally don’t know what to do with it yet! Plotly can only import path collections linked to ‘data’ coordinates”
Is it possible to generate this type of plots by using plotly?
I had the same issue and my solution was as followed:
from statsmodels.tsa.stattools import pacf
import plotly.graph_objects as go
# df['sum'] is my time series where i want the pacf of.
df_pacf = pacf(df['sum'], nlags=300)
fig = go.Figure()
fig.add_trace(go.Scatter(
x= np.arange(len(df_pacf)),
y= df_pacf,
name= 'PACF',
))
fig.update_xaxes(rangeslider_visible=True)
fig.update_layout(
title="Partial Autocorrelation",
xaxis_title="Lag",
yaxis_title="Partial Autocorrelation",
# autosize=False,
# width=500,
height=500,
)
fig.show()