title: Plotly: How to assign specific colors for categories?
body: <p>I have a pandas dataframe of electricity generation mix. So it consists of electricity generation by different fuels. I want to assign a specific color to a specific fuel.
  <a href="https://i.stack.imgur.com/uldxE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uldxE.png" alt="enter image description here" /></a>
  In Matplotlib, it is convenient to assign a specific color to a specific category by passing a list of colors, e.g.</p>
  <blockquote>
  <p>df.plot(kind=&quot;bar&quot;,color=[&quot;red&quot;,&quot;green&quot;,&quot;yellow&quot;]
  <a href="https://i.stack.imgur.com/hQmG3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hQmG3.png" alt="enter image description here" /></a></p>
  </blockquote>
  <p>I wasn't able to assign color similarly for plots using Plotly. What would be the best way to assign specific color to specific categories in Plotly?
  <a href="https://i.stack.imgur.com/qMnIP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qMnIP.png" alt="enter image description here" /></a></p>