Invalid Graphics state

error in plot.new and invalid graphics state

plot(as.zoo(stocks[, c("AMZN.Close", "TSLA.Close")]), screens = 1, lty = 1:2, xlab = "Date", ylab = "Price")
par(new = TRUE)
plot(as.zoo(stocks[, "GOOGL.Close"]), screens = 1, lty = 3, xaxt = "n", yaxt = "n", xlab = "", ylab = "")
axis(4)
mtext("Price", side = 4, line = 3)
legend("topleft", c("AMZN (left)", "TSLA (left)", "GOOGL"), lty = 1:3, cex = 0.5)

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.