如何更改坐标轴刻度
x <- c(1:10)
y <- round(runif(10,min = 80 , max = 100))
plot(x,y,type = 'l',ylim = c(60,100))
如何让x轴,每1画一个刻度,让y轴,每10画一个刻度。
返回小木虫查看更多
今日热帖
x <- c(1:10)
y <- round(runif(10,min = 80 , max = 100))
plot(x,y,type = 'l',ylim = c(60,100))
如何让x轴,每1画一个刻度,让y轴,每10画一个刻度。
返回小木虫查看更多
用ggplot2这个包,看包作者写的书
怎么回事呀
,
没有安装 ggplot 这个包,还是 ggplot2。
就用plot能不能实现我的要求,定义坐标轴刻度
require(ggplot2)
df <- data.frame(x <- c(1:10),
y <- round(runif(10,min = 80 , max = 100)))
ggplot(df, aes(x = x, y = y)) +
geom_line() +
scale_x_continuous(breaks = seq(1,10), limits = c(1,10)) +
scale_y_continuous(breaks = seq(60, 100, by = 10), limits = c(60, 100))