Plot a custom seasonal component using Plotly. See plot_plotly() for Plotly setup instructions Parameters ---------- m: Prophet model. name: Seasonality name, like 'daily', 'weekly'. uncertainty: Optional boolean to plot uncertainty intervals, which will only be done
(m, name, uncertainty=True, figsize=(900, 300))
| 808 | |
| 809 | |
| 810 | def plot_seasonality_plotly(m, name, uncertainty=True, figsize=(900, 300)): |
| 811 | """Plot a custom seasonal component using Plotly. |
| 812 | See plot_plotly() for Plotly setup instructions |
| 813 | |
| 814 | Parameters |
| 815 | ---------- |
| 816 | m: Prophet model. |
| 817 | name: Seasonality name, like 'daily', 'weekly'. |
| 818 | uncertainty: Optional boolean to plot uncertainty intervals, which will |
| 819 | only be done if m.uncertainty_samples > 0. |
| 820 | figsize: Set the plot's size (in px). |
| 821 | |
| 822 | Returns |
| 823 | ------- |
| 824 | A Plotly Figure. |
| 825 | """ |
| 826 | props = get_seasonality_plotly_props(m, name, uncertainty) |
| 827 | layout = go.Layout( |
| 828 | width=figsize[0], |
| 829 | height=figsize[1], |
| 830 | showlegend=False, |
| 831 | xaxis=props['xaxis'], |
| 832 | yaxis=props['yaxis'] |
| 833 | ) |
| 834 | fig = go.Figure(data=props['traces'], layout=layout) |
| 835 | return fig |
| 836 | |
| 837 | |
| 838 | def get_forecast_component_plotly_props(m, fcst, name, uncertainty=True, plot_cap=False): |
nothing calls this directly
no test coverage detected
searching dependent graphs…