![]() To use RColorBrewer define marker list(color brewer. ![]() A and B) and predefined R colors for the other bars (i.e. Furthermore, we have used hex color codes for some of the bars (i.e. Note that we have specified the same color for two of the bars (i.e. Library ( plotly ) x % add_trace ( y = ~ China, name = 'China', marker = list ( color = 'rgb(26, 118, 255)' )) fig % layout ( title = 'US Export of Plastic Scrap', xaxis = list ( title = "", tickfont = list ( size = 14, color = 'rgb(107, 107, 107)' )), yaxis = list ( title = 'USD (millions)', titlefont = list ( size = 16, color = 'rgb(107, 107, 107)' ), tickfont = list ( size = 14, color = 'rgb(107, 107, 107)' )), legend = list ( x = 0, y = 1, bgcolor = 'rgba(255, 255, 255, 0)', bordercolor = 'rgba(255, 255, 255, 0)' ), barmode = 'group', bargap = 0.15, bargroupgap = 0.1 ) fig It actually has a built in color argument where you can set the color of all the points, or provide it a vector (as long as the input) to colour each point individually. As shown in Figure 3, the previously shown R programming code plotted a barchart with user-defined colors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |