title: Plotly: How to change line style using px.line?
body: <p>I have dataframe tha tlooks similar to this:</p>
  <pre><code>&gt;&gt;&gt;Hour    Level   value   
  0  7        H      1.435
  1  7        M      3.124
  2  7        L      5.578
  3  8        H      0.435
  4  8        M      2.124
  5  8        L      4.578
  </code></pre>
  <p>I want to create line chart in plotly that will have different line style based in the column &quot;level&quot;.</p>
  <p>Right now I have the line chart with the deafult line style:</p>
  <pre><code>import plotly.graph_objects as go
  fig = px.line(group, x=&quot;Hour&quot;, y=&quot;value&quot;,color='level', title='Graph',category_orders={'level':['H','M','L']}
               ,color_discrete_map={'H':'royalblue','M':'orange','L':'firebrick'})
  
  fig.show()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/75YAi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/75YAi.png" alt="enter image description here" /></a></p>
  <p>I would like to control the linestyle for each level.
  until know I saw that the only way to do this is to add for each &quot;level&quot;  but using add_trace as following:</p>
  <pre><code># Create and style traces
  fig.add_trace(go.Scatter(x=&quot;Hour&quot;, y=&quot;value&quot;, name='H',
                           line=dict(dash='dash')))
  fig.add_trace(go.Scatter(x=&quot;Hour&quot;, y=&quot;value&quot;, name = 'M',
                           line=dict(dash='dot')))
  fig.show()
  </code></pre>
  <p>but I keep getting this error:</p>
  <blockquote>
  <p>ValueError:
  Invalid value of type 'builtins.str' received for the 'x' property of scatter
  Received value: 'Hour'</p>
  <pre><code>The 'x' property is an array that may be specified as a tuple,
  list, numpy array, or pandas Series
  </code></pre>
  </blockquote>
  <p><strong>My end goal is to control the linestyle of the lines in my charts, better if I can do thatinside the part of &quot;px.line&quot;</strong></p>