@@ -93,7 +93,7 @@ import plotly.express as px
9393df = px.data.stocks(indexed = True )
9494fig = px.line(df, facet_col = " company" , facet_col_wrap = 2 )
9595fig.add_hline(y = 1 , line_dash = " dot" ,
96- annotation_text = " Jan 1, 2018 baseline" ,
96+ annotation_text = " Jan 1, 2018 baseline" ,
9797 annotation_position = " bottom right" )
9898
9999fig.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
110110``` python
111111import plotly.express as px
112112df = 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' ,
114114 facet_col = " day" , facet_row = " time" )
115115
116116import statsmodels.api as sm
@@ -119,7 +119,7 @@ df = df.sort_values(by="total_bill")
119119model = sm.OLS(df[" tip" ], sm.add_constant(df[" total_bill" ])).fit()
120120
121121# 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(),
123123 line_color = " black" , name = " overall OLS" )
124124
125125# give it a legend group and hide it from the legend
0 commit comments