我需要y轴上的值是GNP的值,从500到3000,而不是从1到20。 这是我绘制图形的代码。
library(lattice)
data(Investment, package="sandwich")
Investment <- as.data.frame(Investment)
stripplot(Investment$GNP~Investment$Investment|"Graphic",
right = F, xlab="Investment", ylab="GNP")
提前谢谢
答案 0 :(得分:1)
您应该使用xyplot
代替:
library(lattice)
data(Investment, package = "sandwich")
Investment <- as.data.frame(Investment)
xyplot(
x = GNP ~ Investment | "Graphic",
data = Investment,
right = F,
xlab = "Investment",
ylab = "GNP"
)