title: Plotting plots in same colors
body: <p>I working with plotly in R. I am trying to plot charts with the same colors. Below you can see data and charts.</p>
  <pre><code>library(plotly)
  library(reshape2)
  library(dplyr)
  
  df&lt;-data.frame(city=c(&quot;NYC&quot;,&quot;Seattle&quot;,&quot;Boston&quot;,&quot;LA&quot;,&quot;Seattle&quot;),
                 value=c(100,200,300,400,500))
  df &lt;-melt(df)
  </code></pre>
  <p>Now I am plotting pie chart with colors shown below:</p>
  <pre><code>fig&lt;-df %&gt;% 
    plot_ly(labels = ~city, values = ~value)
  fig &lt;- fig %&gt;% add_pie(hole = 0.6)
  fig
  </code></pre>
  <p><a href="https://i.stack.imgur.com/r9ViI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r9ViI.png" alt="enter image description here" /></a></p>
  <p>Finally, I want to plot a bar chart with the same colors as the pie plot, shown above. In order to  do this, I tried this command lines :</p>
  <pre><code>df &lt;-melt(df)
  fig &lt;- plot_ly(df, x = ~city, y = ~value, type = 'bar')
  fig
  </code></pre>
  <p><a href="https://i.stack.imgur.com/lYEd0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lYEd0.png" alt="enter image description here" /></a></p>
  <p>So can anybody help me with how to plot a barplot with the same colors as pie chart ?</p>