-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot.R
43 lines (35 loc) · 1002 Bytes
/
plot.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
library(ggplot2)
# theme_set(theme_bw(text(size=rel(2))))
theme_set(
theme_bw(base_size=18)
## %+replace% theme(axis.text = element_text(size = rel(2.0)))
)
tstitle <- ifelse(is.null(gtitle), "Time series", gtitle)
ts <- (
ggplot(dat, aes(x=x, y=y))
+ geom_point() + geom_line()
+ xlab(xlab) + ylab(ylab)
+ ggtitle(tstitle)
)
print(ts)
print(ts + scale_y_log10())
## steptitle <- ifelse(is.null(gtitle), "Step-forward", gtitle)
steptitle <- "Step-forward"
print(
ggplot(dat, aes(x=y, y=yp))
+ geom_point() + geom_smooth(method="lm", formula=y~poly(x, 2))
+ geom_abline(slope=1, intercept=0)
+ xlab(ylab) + ylab("Next observation")
+ ggtitle(steptitle)
)
## inctitle <- ifelse(is.null(gtitle), "Rate of increase", gtitle)
inctitle <- "Rate of increase"
lamp <- (
ggplot(dat, aes(x=y, y=lam))
+ geom_point() + geom_smooth(method="lm")
+ geom_abline(slope=0, intercept=1)
+ xlab(ylab) + ylab("Finite rate of increase")
+ ggtitle(inctitle)
)
print(lamp)
print(lamp+scale_x_log10())