Skip to content

Commit 00b07f2

Browse files
committed
put loess regression line on scatterplot and mean on histogram
1 parent 6cb35ae commit 00b07f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/plotSimulationDiagnostics.R

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# File: plotSimulationDiagnostics.R
44
# Author: Alex Stivala
5-
# Created: February 2014
5+
# Created: November 2019
66
#
77
# Derived from plotPNetSimulationDiagnostics.R (ADS Feb. 2014).
88
#
@@ -44,12 +44,16 @@ for (statname in statnames) {
4444

4545
p <- ggplot(simstats_statname, aes(x=t, y=value))
4646
p <- p + geom_point()
47+
p <- p + geom_smooth(method = loess, color = "blue", linetype = "dashed",
48+
se = FALSE)
4749
p <- p + xlab('t')
4850
p <- p + ylab(statname)
4951
plotlist <- c(plotlist, list(p))
5052

5153
p <- ggplot(simstats_statname, aes(x=value))
5254
p <- p + geom_histogram()
55+
p <- p + geom_vline(aes(xintercept = mean(value)), color = "blue",
56+
linetype = "dashed")
5357
p <- p + xlab(statname)
5458
plotlist <- c(plotlist, list(p))
5559
}

0 commit comments

Comments
 (0)