'Remove borders in plotly treemap

I'm currently plotting some data using the plotly R library for the plot type treemap.

When plotting the data, I get a big top border (and smaller ones on right, left and bottom) as visible in this example Treemap Plotly

I would like to eliminate these borders, in order to have something similar to this Treemap without borders

Is there a way to do this?



Solution 1:[1]

The borders can be removed by combing a zero line width with zero tile padding.

Here's an example that Plotly has put on their site with the standard borders.

# example from at https://plotly.com/r/treemaps/
plot_ly(
  type="treemap",
  labels=c("Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"),
  parents=c("", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve")
)

enter image description here

Here is the same plot without borders.

# no borders
plot_ly(
  type="treemap",
  labels=c("Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"),
  parents=c("", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"),
  marker = list(line = list(width = 0)),
  tiling = list(pad = 0))

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kat