我正在制作一个散点图,我试图在x轴上从0到350每隔50毫克制作刻度线,并且对于y轴,每隔25毫克刻度标记从0到350。
这是我的代码:
cereal <- read.csv("cereal.txt")
attach(cereal)
library(vcd)
plot(sodium, potass, main='Sodium vs Potassium of Cereals', ylab="Potassium", xlab="Sodium")
axis(1,tck=2, at=seq(0,350by=50))
axis(2,tck=2, at=seq(0,350by=25))
但是我收到以下错误:
> axis(1,tck=2, at=seq(0,350by=50))
Error: unexpected symbol in "axis(1,tck=2, at=seq(0,350by"
> axis(2,tck=2, at=seq(0,350by=25))
Error: unexpected symbol in "axis(2,tck=2, at=seq(0,350by"