How to set plotly chart to have a transparent background in R?

前端 未结 2 1127
情话喂你
情话喂你 2021-02-07 21:32

Here\'s what I have, so far:

f1 <- list(
   family = \"Arial, sans-serif\",
   size = 25,
   color = \"white\"
)
f2 <- list(
   family = \"Old Standard TT,         


        
2条回答
  •  无人共我
    2021-02-07 22:09

    Just try:

    salesplot <-plot_ly(producersales, type="scatter", x=Producer, y=SalesPerSong, color=SongRange, colors=cols, mode="markers", size=SalesPerSong) %>% 
    layout(xaxis = a, yaxis = a) %>% 
    layout(plot_bgcolor='rgb(254, 247, 234)') %>% 
    layout(paper_bgcolor='rgb(254, 247, 234)') #will also accept paper_bgcolor='black' or paper_bgcolor='transparent'
    

    You can change the rgb numbers to fit your needs.

提交回复
热议问题