Skip to content

Commit 59b56a0

Browse files
committed
better plotting strategy
1 parent a457443 commit 59b56a0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

extras/sp500/sp500_long.Rmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,10 @@ sp500$estimate <- exp(approx(soln$x, soln$pred,
9494
9595
sp500$group <- as.character(
9696
findInterval(sp500$x, soln[soln$what=="left", "x"]))
97-
colors <- rep("darkgreen", length(unique(sp500$group)) + 5)
9897
9998
ggplot(data = sp500, aes(x = Date)) +
10099
geom_line(aes(y=Adj.Close), color = "darkgray") +
101-
geom_line(aes(y=estimate, color = group)) +
100+
geom_line(aes(y=estimate, group = group), color = "darkgreen") +
102101
ggtitle("segment approximation of historic sp500 data",
103102
subtitle = paste("per-segment penalty =", penalty)) +
104103
theme(legend.position = "none") +

extras/sp500/sp500_long.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ sp500$estimate <- exp(approx(soln$x, soln$pred,
100100

101101
sp500$group <- as.character(
102102
findInterval(sp500$x, soln[soln$what=="left", "x"]))
103-
colors <- rep("darkgreen", length(unique(sp500$group)) + 5)
104103

105104
ggplot(data = sp500, aes(x = Date)) +
106105
geom_line(aes(y=Adj.Close), color = "darkgray") +
107-
geom_line(aes(y=estimate, color = group)) +
106+
geom_line(aes(y=estimate, group = group), color = "darkgreen") +
108107
ggtitle("segment approximation of historic sp500 data",
109108
subtitle = paste("per-segment penalty =", penalty)) +
110109
theme(legend.position = "none") +

0 commit comments

Comments
 (0)