Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想做一个像这样的简单图表:
ff<-data.frame(Freq=c(rep(10000,10),rep(100,15),rep(10,50),rep(1,100))) plot(log(ff$Freq),type="l")
是添加 ax 变量的唯一选择吗?
require(ggplot2) ff$Ord <- 1:nrow(ff) ggplot(data=ff,aes(x=Ord,y=log(Freq))) + geom_line()
提前致谢
这是 geom_step() 的一种方法:
library(ggplot2) library(scales) ggplot(ff, aes(x = seq_along(Freq), y = log10(Freq))) + geom_step(size = 1) + labs(x = "Index", y = "Freq") + scale_y_continuous(labels = math_format(10^.x))