Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ggplot2)
- # Generate data
- a<-seq(1,101,1)
- b<-1.1^(a)+.7*rnorm(length(a))*1.1^(a)
- df<-data.frame(a,b)
- ggplot(df, aes(b,a))+
- geom_point(shape=21, size=3, color="black", fill="steelblue1")+
- labs(title="Exploring X-Semilog",
- subtitle="Before transformation",
- x="Data (units)",
- y="Data (units)")+
- theme_bw()
- ggsave("before.png", height=5, width=7, dpi=120, type="cairo-png")
- ggplot(df, aes(b,a))+
- geom_point(shape=21, size=3, color="black", fill="steelblue1")+
- scale_x_log10(breaks=10^seq(0,4,2),
- minor_breaks=as.vector(outer(10^seq(0,4,2), 1:10, "*")))+
- labs(title="Exploring X-Semilog",
- subtitle="After transformation",
- x="Data (units)",
- y="Data (units)")+
- theme_bw()
- ggsave("after.png", height=5, width=7, dpi=120, type="cairo-png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement