Y Axis - Margin Size

Hi,
How can I change the Y axis margin’s size in order to fit the size of the words that appear in the axis?

The code is:
p <- plot_ly()
p <- add_trace(p, wordfreq, x =wordfreq[,2] , y = wordfreq[,1],
marker = list(
color = “#1327d8”,
line = list(
color = “rgba(58, 71, 80, 1.0)”,
width = 1
)
),
orientation=“h”,
type=“bar”)

p <- layout(p, title=“Word Frequency”,
xaxis=list(
title = “Word Count”,
titlefont = list(
color = “#484848”,
family = “Helvetica”,
size = 18
)
),
yaxis=list(
title = “”,
titlefont = list(
color = “#484848”,
family = “Helvetica”,
size = 15), autorange=TRUE))

Thanks
Ricardo

Hey @Ricardogs,

you can control margins like the following:

p <- plot_ly(height = 800, width = 600) %>%     
       add_trace(x=1,y=1) %>%   
layout(margin = list(l = 50, r = 50, b = 50, t = 50, pad = 4))

see link for reference info https://plot.ly/r/reference/#layout-margin

Thanks, Works fine!

Enviado do Email para Windows 10

I programmed a little interactive app that let’s you play round with the margins and other layout parameters: https://paulcbauer.shinyapps.io/plotlylayout/ Maybe that’s helpful.

How to do this margin modification in Matlab?