I successfully removed unwanted dates in a plot using the 'bdscale' packaget that were causing a known smooth curve to render in a jagged fashion due to weekends and holidays being accounted for on the x-axis. See ggplot2: remove blank space for weekends and holidays from x-axis dates. However, now my Dates no longer render correctly. I am certain there is an easy fix, but the solution escapes me. Any assistance is greatly appreciated.
The csv file is located at my github site https://github.com/123blee/123blee.github.io/blob/main/data1.csv and I call the dataframe 'xxx' in the code.
library(plotly)
library(bdscale)
library(scales)
# Data file - https://github.com/123blee/123blee.github.io/blob/main/data1.csv
# https://stackoverflow.com/questions/32893176/ggplot2-remove-blank-space-for-weekends-and-holidays-from-x-axis-dates
ggplotly(
ggplot(data = xxx, aes(x = Date)) +
geom_line(aes(y = a), color = "blue") +
geom_line(aes(y = b), color="black") +
theme(panel.grid.minor = element_line(colour="white", size=0.2)) +
scale_x_bd(business.dates=xxx$Date, max.major.breaks=10) +
ylim( 10, 25 )
)