friends!
If I plot a bar charts using plotly in R, by default I have no spacing between bars.
My questions are:
Thanks a lot!
This can happen when using a numeric x axis... try putting as.factor(VARIABLE)
example: count the number of rows that contain the graduating class of the df = data frame you are plotting; x = variable you are plotting
plot_ly(df, x = df$x)
-this gives you a messy looking blob
plot_ly(df, x = as.factor(df$x))
-now it is known that your x axis is a factor, it will separate each value and break it up with a space in between
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.