0

I am making a bar chart in R using Plotly.

plot_ly(y = times_by_country$Country, x= times_by_country$avg_finish_time_sec, type = "bar", orientation="h") %>%
    layout(
        title="Average Finish Time by Country",
        yaxis= list(title="Country", categoryorder= "total descending"),
        xaxis= list(title="Mean Finish Time") 
    )

It produces the following chart, but since there are so many bars, we're unable to see the labels of each.

enter image description here

How could we set the bar width / height such that we can see each bar's label?

I tried the bar gap parameter, but that controls the gap between bars, not their size.

s2t2
  • 2,462
  • 5
  • 37
  • 47
  • It would be easier to help you if you provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a snippet of your data or some fake data. – stefan Sep 21 '22 at 18:54
  • This said: The issue is not the width of the bars. It's the axis labels, i.e. you could try by reducing the font size using e.g. `yaxis= list(..., tickfont = list(size = 7))`. Or simply increase the height of your plot. – stefan Sep 21 '22 at 18:56

0 Answers0