- Specified with
layout(margin = list(..))
(see here)
b
: Sets the bottom margin (in px)
l
: Sets the left margin (in px)
r
: Sets the right margin (in px)
t
: Sets the top margin (in px)
pad
: Sets the amount of padding (in px) between the plotting area and the axis lines
- See https://paulcbauer.shinyapps.io/plotlylayout/
p <- plot_ly(data = swiss, x = ~Catholic, y = ~Fertility, type = "scatter", mode = "markers")
p <- layout(p, autosize = F,
paper_bgcolor='#D4D4D4',
plot_bgcolor='white',
width = 300,
height = 300,
margin = list(b = 80, l = 80, r = 80, t = 100, pad = 0, autoexpand = TRUE)
)
## Warning: Specifying width/height in layout() is now deprecated.
## Please specify in ggplotly() or plot_ly()