p <- ggplot(plotData, aes(x = variable, y = value, colour = catVar,
group = catVar))
p <- p + stat_summary(fun.y = mean, geom = "line")
p <- p + stat_summary(fun.ymax = errorUpper, fun.ymin = errorLower,
geom = "errorbar", width=0.25)
Even if I print the plot without errorbars, the y-limit is too high.
It looks like it takes the raw data to calculate the y-limit instead
of the summarized data. Is it true? Is there any other solution beside
changing the viewport?
Or is there any mistake I'm not aware of?
On Mon, Jan 17, 2011 at 08:34, july <antje.niederl...@googlemail.com> wrote: > Hi there,
> I've created a plot with the following commands:
> p <- ggplot(plotData, aes(x = variable, y = value, colour = catVar, > group = catVar)) > p <- p + stat_summary(fun.y = mean, geom = "line") > p <- p + stat_summary(fun.ymax = errorUpper, fun.ymin = errorLower, > geom = "errorbar", width=0.25)
> Even if I print the plot without errorbars, the y-limit is too high. > It looks like it takes the raw data to calculate the y-limit instead > of the summarized data. Is it true? Is there any other solution beside > changing the viewport? > Or is there any mistake I'm not aware of?
> -- > You received this message because you are subscribed to the ggplot2 mailing > list. > Please provide a reproducible example: http://gist.github.com/270442
> To post: email ggplot2@googlegroups.com > To unsubscribe: email ggplot2+unsubscribe@googlegroups.com<ggplot2%2Bunsubscribe@googlegroups.com > > More options: http://groups.google.com/group/ggplot2
Okay, I was not yet aware of this option (I reached this chapter of
the book today :-)).
Anyhow, it's a bit annoying to group the data and calculate the ranges
of the summarized values by myself. This is exactly what ggplot tries
to avoid, no?
A
On Jan 17, 10:13 am, Brandon Hurr <brandon.h...@gmail.com> wrote:
> p + coord_cartesian(ylim = c(325, 500), wise=TRUE)
> I'm not sure if it is taking into account the data range or the range of
> what is being plotted though.
> B
> On Mon, Jan 17, 2011 at 08:34, july <antje.niederl...@googlemail.com> wrote:
> > Hi there,
> > I've created a plot with the following commands:
> > p <- ggplot(plotData, aes(x = variable, y = value, colour = catVar,
> > group = catVar))
> > p <- p + stat_summary(fun.y = mean, geom = "line")
> > p <- p + stat_summary(fun.ymax = errorUpper, fun.ymin = errorLower,
> > geom = "errorbar", width=0.25)
> > Even if I print the plot without errorbars, the y-limit is too high.
> > It looks like it takes the raw data to calculate the y-limit instead
> > of the summarized data. Is it true? Is there any other solution beside
> > changing the viewport?
> > Or is there any mistake I'm not aware of?
> > --
> > You received this message because you are subscribed to the ggplot2 mailing
> > list.
> > Please provide a reproducible example:http://gist.github.com/270442
> > To post: email ggplot2@googlegroups.com
> > To unsubscribe: email ggplot2+unsubscribe@googlegroups.com<ggplot2%2Bunsubscribe@googlegroups.com >
> > More options:http://groups.google.com/group/ggplot2
On Tue, Jan 18, 2011 at 3:17 AM, july <antje.niederl...@googlemail.com> wrote: > Okay, I was not yet aware of this option (I reached this chapter of > the book today :-)). > Anyhow, it's a bit annoying to group the data and calculate the ranges > of the summarized values by myself. This is exactly what ggplot tries > to avoid, no?
>> p + coord_cartesian(ylim = c(325, 500), wise=TRUE)
>> I'm not sure if it is taking into account the data range or the range of >> what is being plotted though.
>> B
>> On Mon, Jan 17, 2011 at 08:34, july <antje.niederl...@googlemail.com> wrote: >> > Hi there,
>> > I've created a plot with the following commands:
>> > p <- ggplot(plotData, aes(x = variable, y = value, colour = catVar, >> > group = catVar)) >> > p <- p + stat_summary(fun.y = mean, geom = "line") >> > p <- p + stat_summary(fun.ymax = errorUpper, fun.ymin = errorLower, >> > geom = "errorbar", width=0.25)
>> > Even if I print the plot without errorbars, the y-limit is too high. >> > It looks like it takes the raw data to calculate the y-limit instead >> > of the summarized data. Is it true? Is there any other solution beside >> > changing the viewport? >> > Or is there any mistake I'm not aware of?
>> > -- >> > You received this message because you are subscribed to the ggplot2 mailing >> > list. >> > Please provide a reproducible example:http://gist.github.com/270442
>> > To post: email ggplot2@googlegroups.com >> > To unsubscribe: email ggplot2+unsubscribe@googlegroups.com<ggplot2%2Bunsubscribe@googlegroups.com > >> > More options:http://groups.google.com/group/ggplot2
> -- > You received this message because you are subscribed to the ggplot2 mailing list. > Please provide a reproducible example: http://gist.github.com/270442
> To post: email ggplot2@googlegroups.com > To unsubscribe: email ggplot2+unsubscribe@googlegroups.com > More options: http://groups.google.com/group/ggplot2
-- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/