unable to plot line chart using xlim

I have a data set of forex trade from 2005 to 2020. I want to plot a simple line chart and graph using plotly. I amnot able to plot it. I am using following codes for simple plot and plotly

plot(data_libor$date, data_libor$libor_1m, type = "l",col = "red", xlim = c(2010,2020),xlab = "Year", ylab = "LIBOR (%)",
lwd= 2,main = "LIBOR rate for 1M, 3M, and 6M")
lines(data_libor$date, data_libor$libor_3m, type = "l", col = "blue", lwd = 2)
lines(data_libor$date, data_libor$libor_6m, type = "l", col = "green", lwd = 2)
legend("topright", legend=c("1-Month", "3-Months","6-Months"),
col=c("red", "blue","green"), lty = 1:2, cex=0.7)

plot_1m <- plot_ly(x=data_forward_spot$date,y=profit_1m, xlim= c(2010,2020) ,type = "scatter", mode = "lines",
line = list(color = 'hsl(0, 100%, 50%)', width = 2))
plot_1m <- plot_1m %>% layout(title = "Arbitrage profit with 1 Month forward USD/INR rate ",
xaxis = list(title = "Year"),yaxis = list(title = "Profit (INR)"))
plot_1m

Thanks in advance.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.