Dennis
2012-Sep-16  08:06 UTC
[R] How to plot two lines, and only one line with errorbar by qqplots of R
Here is my code, which plots three lines with errorbar. How could I add an
extra line without errorbar to the plot? Thank you very much.
beta.data <- data.frame (
method = rep(c("Wrong", "Correct", "Full Bayes"),
each = T_obs),
mean.beta = c(mean.beta1, mean.beta2, mean.beta3),
t = rep(points, 3),
std.beta = c(std.beta1, std.beta2, std.beta3)
)
limits = aes(ymin = mean.beta - std.beta, ymax = mean.beta + std.beta);
maintitle = paste("beta function (std = ", std, ")", sep =
"");
p + geom_line() + geom_errorbar(limits, width = 0.05) + ggtitle(maintitle) +
  theme(legend.title=element_blank(), legend.justification=c(0,1),
  legend.position=c(0,1))+
  scale_x_continuous(breaks=seq(0, 10, .1)) +
  scale_y_continuous(breaks=seq(0, 13, .1)) +
  ylab("Beta(t)") + scale_colour_hue(breaks=c("Wrong",
"Correct", "Full Bayes"))
	[[alternative HTML version deleted]]
R. Michael Weylandt
2012-Sep-16  12:42 UTC
[R] How to plot two lines, and only one line with errorbar by qqplots of R
On Sun, Sep 16, 2012 at 9:06 AM, Dennis <dcflyer at gmail.com> wrote:> Here is my code, which plots three lines with errorbar. How could I add an > extra line without errorbar to the plot? Thank you very much. > > > beta.data <- data.frame ( > method = rep(c("Wrong", "Correct", "Full Bayes"), each = T_obs), > mean.beta = c(mean.beta1, mean.beta2, mean.beta3), > t = rep(points, 3), > std.beta = c(std.beta1, std.beta2, std.beta3) > ) > > > limits = aes(ymin = mean.beta - std.beta, ymax = mean.beta + std.beta); > maintitle = paste("beta function (std = ", std, ")", sep = ""); > > > p + geom_line() + geom_errorbar(limits, width = 0.05) + ggtitle(maintitle) + > theme(legend.title=element_blank(), legend.justification=c(0,1), > legend.position=c(0,1))+ > scale_x_continuous(breaks=seq(0, 10, .1)) + > scale_y_continuous(breaks=seq(0, 13, .1)) + > ylab("Beta(t)") + scale_colour_hue(breaks=c("Wrong", "Correct", "Full Bayes")) >Hi Dennis, Your code is not reproducible (inter alia we don't have "p"): could you perhaps work on making it reproducible for the rest of us? http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Cheers, Michael