Change the root color of a treemap trace when using a colorscale

This is a crosspost.

When using a colorscale on a treemap trace (without providing a root) the container is shown in black:

image

library(plotly)

labels = c("A1", "A2", "A3", "A4", "A5", "B1", "B2")
parents = c("", "A1", "A2", "A3", "A4", "", "B1")
values = c("11", "12", "13", "14", "15", "20", "30")

fig <- plot_ly(
  type="treemap",
  labels=labels,
  parents=parents,
  values=values,
  marker=list(colorscale='Reds'))

fig

Example taken from here: Treemap Charts | R | Plotly

I'd like to change it to white.

In the python plotly library there is a root_color argument to do so:

fig.update_traces(root_color="lightgrey")

see: Treemap Charts | Python | Plotly

Is there any workaround to achive this in R? I can't find the according option.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.