title: Plotly line opacity with plotly.express
body: <p>I am doing some line plots with <code>plotly.express</code>. As MWE we can consider any of the examples in the documentation, for example <a href="https://plotly.com/python/line-charts/#line-plots-with-column-encoding-color" rel="nofollow noreferrer">this one</a> which is:</p>
  <pre class="lang-py prettyprint-override"><code>import plotly.express as px
  
  df = px.data.gapminder().query(&quot;continent=='Oceania'&quot;)
  fig = px.line(df, x=&quot;year&quot;, y=&quot;lifeExp&quot;, color='country', facet_row='country')
  fig.show()
  </code></pre>
  <p>How would you change the opacity of the lines, without altering their color or any other of their properties?</p>
  <p>I have tried to use <code>fig.update_traces(line=dict(width=1, opacity=.4))</code>, the <code>width</code> property works but <code>opacity</code> raises an error.</p>
  <p>In the past with <code>plotly.graph_objects</code> I have used the answers to <a href="https://stackoverflow.com/q/50488894/8849755">this question</a> but this requires me to choose the color, this time I want <code>plotly.express</code> to do that for me. So I don't know the color of each trace.</p>