@@ -93,7 +93,7 @@ import plotly.express as px
93
93
df = px.data.stocks(indexed = True )
94
94
fig = px.line(df, facet_col = " company" , facet_col_wrap = 2 )
95
95
fig.add_hline(y = 1 , line_dash = " dot" ,
96
- annotation_text = " Jan 1, 2018 baseline" ,
96
+ annotation_text = " Jan 1, 2018 baseline" ,
97
97
annotation_position = " bottom right" )
98
98
99
99
fig.add_vrect(x0 = " 2018-09-24" , x1 = " 2018-12-18" , col = 1 ,
@@ -110,7 +110,7 @@ The `.add_trace()` method can be used to add a copy of the same trace to each fa
110
110
``` python
111
111
import plotly.express as px
112
112
df = px.data.tips()
113
- fig = px.scatter(df, x = " total_bill" , y = " tip" , color = ' sex' ,
113
+ fig = px.scatter(df, x = " total_bill" , y = " tip" , color = ' sex' ,
114
114
facet_col = " day" , facet_row = " time" )
115
115
116
116
import statsmodels.api as sm
@@ -119,7 +119,7 @@ df = df.sort_values(by="total_bill")
119
119
model = sm.OLS(df[" tip" ], sm.add_constant(df[" total_bill" ])).fit()
120
120
121
121
# create the trace to be added to all facets
122
- trace = go.Scatter(x = df_sorted [" total_bill" ], y = model.predict(),
122
+ trace = go.Scatter(x = df [" total_bill" ], y = model.predict(),
123
123
line_color = " black" , name = " overall OLS" )
124
124
125
125
# give it a legend group and hide it from the legend
0 commit comments