search for: psavert

Displaying 5 results from an estimated 5 matches for "psavert".

Did you mean: pcalert
2009 Mar 11
1
Ggplot2: saving a grid with multiple plots
...tiple plots in it. Something like the example below. When I save that with ggsave(), only the last plot gets saved (pPath in the example) instead of the entire figure. Any suggestions how I can save this kind of figures automated? Thanks, Thierry library(ggplot2) pPoint <- qplot(unemploy/pop, psavert, data=economics) pPath <- qplot(unemploy/pop, psavert, data=economics, geom="path") grid.newpage() pushViewport(viewport(layout = grid.layout(2, 1))) print(pPoint, vp = viewport(layout.pos.row = 1, layout.pos.col = 1)) print(pPath, vp = viewport(layout.pos.row = 2, layout.pos.col = 1))...
2009 May 14
1
text() to label points in ggplot
is there a way to label points in a graph using text(locator(1),"text") after ggplot() or qplot() ? > qplot(date, psavert, data = economics, geom = "line",main="jhdjd")->p > p+opts(text(locator(1),"HHHH"),new=T) does not work. -- View this message in context: http://www.nabble.com/text%28%29-to-label-points-in-ggplot-tp23545135p23545135.html Sent from the R help mailing list archi...
2012 Mar 05
2
ggplot2
I just updated to R 2.14 with ggplot2 0.9 and am finding bugs. > ggplot2 "GPL-2" "2.14.0" This example is taken from pg 101 in the ggplot book. > plot <- qplot(date, psavert, data = economics, geom = "line") + > ylab("Personal savings rate") + geom_hline(xintercept = 0, colour = > "grey50")' > plot + scale_x_date(major = "10 years") Error in continuous_scale(aesthetics, "date", identity, breaks = breaks, :...
2009 Jan 22
1
ggplot2 example
I need to plot two graphics just like the example below but for some reason your example crashes. Using facet_wrap seems to be the cause: library(ggplot2) upper <- with(economics, data.frame(date,value = psavert, position = "upper")) upper lower <- with(economics, data.frame(date,value = unemploy,position = "lower")) lower #upper$date <- as.Date(upper$date,"%m/%d/%Y") #lower$date <- as.Date(lower$date,"%m/%d/%Y") ggplot(mapping = aes(x=date, y=value)) + geom...
2013 Apr 14
1
Problem plotting continuous and discrete series in ggplot with facet
I have data that plots over time with four different variables. I would like to combine them in one plot using facet_grid, where each variable gets its own sub-plot. The following code resembles my data require(ggplot2) require(reshape2) subm <- melt(economics, id='date', c('psavert','uempmed','unemploy')) mcsm <- melt(data.frame(date=economics$date, q=quarters(economics$date)), id='date') mcsm$value <- factor(mcsm$value) ggplot(subm, aes(date, value, col=variable, group=1)) + geom_line() + facet_grid(variable~., scale='free_y') + ge...