Re: [R] Plot_ly bar plots - bars span sevral x values when there are missing values.

2021-03-18 Thread nevil amos
Hi Rasmus, thanks for that suggestion. It does indeed fix the column widths in this example. the reason it does this is becuase it means that the additonal 0 values added result in values for two adjacent columns. so if adjacent columns are present the "correct" column width is maintained df[c(

Re: [R] Plot_ly bar plots - bars span sevral x values when there are missing values.

2021-03-09 Thread Rasmus Liland
Dear Nevil, Although I am a bit unfamiliar with plotly, it seems it is possible to plot two bars side by side at least: h <- df[3:4,] p <- plotly::plot_ly( data = h, x = ~ x, y = ~ y, type = "bar") p <- plotly::layout(p=p,

[R] Plot_ly bar plots - bars span sevral x values when there are missing values.

2021-03-08 Thread nevil amos
I need to plot a number of bar charts as part of a shiny app. I am using ploty ly x and y values are both numeric x being consecutive integer values. there are often missing values in the data I wish to plot - each plot needs to have a fixed x range. When there are more than a few missing valu