title: How to extract R-squared from plotly px.scatter trendline result?
body: <p>how can I extract R-squared value from the following summary():</p>
  <pre><code>import plotly.express as px
  df = ...
  fig = px.scatter(df, x=&quot;...&quot;, y=&quot;...&quot;, trendline=&quot;ols&quot;) 
  a = px.get_trendline_results(fig).px_fit_results.iloc[0].summary()
  </code></pre>
  <p>I know how to extract coefficients of trendline with <strong>params</strong>:<a href="https://i.stack.imgur.com/O84E1.png" rel="nofollow noreferrer">coef in the picture</a></p>
  <pre><code>print(fit_results.params)
  </code></pre>
  <p>but I need to extract R-squared value from the results to annotate it in static saved figs.</p>