Displaying 20 results from an estimated 1000 matches similar to: "Setting scales for ggplot2 with facets"
2010 May 09
1
Is it possible to rearrange the facets in ggplot while keeping everything else the same?
Hello,
First, ggplot2 is great!
Second, sorry for the basic nature of my question.
I have data in the form of a melt table like this:
Subject Day Ab Variable Value
1 1 Yes A 3
1 3 Yes A 5
1 5 Yes A 7
2 1 No A 2
2 3 No A 4
2 5 No A 6
3 1 Yes A 1
3 3 Yes A 3
3 5 Yes A 5
4 1 No A 4
4 3 No A 6
4 5 No A 8
1 1 Yes B 3
1 3 Yes B 5
1 5 Yes B 7
2 1 No B 2
2 3 No B 4
2 5 No B 6
3 1 Yes B 1
3 3 Yes B 3
3 5
2009 Oct 06
1
ggplot2 applying a function based on facet
Look at the bottom of the message for my question
#here is a little function that I wrote
USGS <- function(input="discharge", days=7){
library(chron)
library(gsubfn)
#021973269 is the Waynesboro Gauge on the Savannah River Proper (SRS)
#02102908 is the Flat Creek Gauge (ftbrfcms)
#02133500 is the Drowning Creek (ftbrbmcm)
#02341800 is the Upatoi Creek Near Columbus (ftbn)
#02342500 is
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,
2011 Feb 16
1
Faceting article
Hi,
I've been involved in developing a fairly complex site at
http://tilt.ft.com recently, and have acquired an unhealthy interest in
faceting. I couldn't find any good non-academic guides to faceting
strategy on the web, so I thought I'd have a stab at writing one.
I'm not completely happy with it, but it's been sitting in my drafts for
long enough that I thought it
2008 Mar 04
1
qplot (ggplot2) faceting histogram with missing values
Hi,
I've run into a difficulty with qplot function (in the ggplot2
package). I can facet histograms even when the faceting variable
contains missing values, but only so long as the faceting variable is
not a factor.
Example:
y1 <- rnorm(10)
x1 <- c(rep(1,5), rep(2,4), NA)
x2 <- factor(c(rep(1,5), rep(2,4), NA))
library(ggplot2)
qplot(y1, geom = "histogram", facets =
2011 Dec 23
1
simple ggplot2 question
Hello,
I am trying to make a plot using the code below. The plot is divided into two parts, using facet_grid. I would like the vertical axis (labelled 'place') to be different for each location (=part). So in the upper part, only places 'n' through 'z' are shown, while in the lower part, only places 'a' through 'm' are shown. I thought 'free_y'
2011 Jun 11
0
problems with geom_vline, histograms, scale=free and facets in ggplot
Dear list,
I?m having a little trouble with adding vertical lines to a histogram.
I need to draw a matrix of histograms (using facets), and in each
histogram add a vertical line indicating the mean value of the data in
each facet. According to the last example in the geom_hline help, to
display different lines in each facet I need to provide a data frame.
I modified this example to make a plot
2012 Oct 22
0
Lattice to ggplot2: Reference graphics across facets
Hi,
I'm playing with moving some of my lattice graphics into ggplot2, and I'd
like to ask how to achieve a couple of things, both of which are fully
illustrated in self-contained code (and mostly minimal, although that left
quite a bit) following this written description.
1. I quite often like to use a 'ghosted' reference across facets - for
example, in my example program below,
2010 Aug 28
1
Matchspy and faceting
Have been working recently on a site that classifies posts using tags in
taxonomies, so a post about the Oil spill in the Gulf of Mexico might be
tagged 'Subscribers only' (access level), 'Barack Obama' (person), 'Tony
Hayward' (person), 'BP' (company), 'Transocean' (company), 'Gulf of
Mexico' (location).
With some advice from Richard Boulton I
2013 Mar 07
3
ggpliot2: reordering of factors in facets facet.grid(). Reordering of factor on x-axis no problem.
Hi everyone (again),
before you all start screaming that the reordering of factors has been
discusse on several threads and is not particular to ggplot2, hear me out.
I can easily reorder my x-axis factor in facet.grid() in ggplot2. What I
cannot reorder are the factors represented on the strips. I can see that the
graphs are changing, so I am afraid of what it is I am doing. Why is ggplot2
2003 Oct 12
1
Swen virus and spam appears to be coming from Samba list
Shortly after I subscribed to this Samba list I started receiving numerous emails infected with the Swen/Gibe worm. Many of these emails contained the email addresses of Samba list members. I believe a subscriber of the Samba list has the Swen virus. Has anyone else on this list been getting emails infected with the Swen/Gibe worm? Please update your virus definitions and do a virus scan just to
2013 Oct 12
2
Order of factors with facets in ggplot2
Hello,
I'd like to produce a ggplot where the order of factors within facets is
based on the average of another variable.
Here's a reproducible example. My problem is that the factors are ordered
similarly in both facets. I would like to have, within each facet of `f1',
boxplots for 'x' within each factor `f2', where the boxplots are ordered
based on the average of x
2008 Nov 17
1
ggplot2: can one have separate ylim for each facet?
In lattice
#toy data
library(ggplot2)
library(lattice)
x <- rnorm(100)
y <- rnorm(100)
k <- sample(c("Weak","Strong"),100,replace=T)
j <- sample(c("Tall","Short"),100,replace=T)
w <- data.frame(x,y,j,k)
xyplot(y~x|j+k,scales=list(y=list(relation="free")))
will give you a scale in each subplot with a range equal to the range
of y
2010 May 18
2
Function that is giving me a headache- any help appreciated (automatic read )
note: whole function is below- I am sure I am doing something silly.
when I use it like USGS(input="precipitation") it is choking on the
precip.1 <- subset(DF, precipitation!="NA")
b <- ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum)
DF.precip <- precip.1
DF.precip$precipitation <- b$.data
part, but runs fine outside of the function:
days=7
2010 Nov 09
1
ggplot2: facet_grid with different vertical lines on each facet
Hello,
I am plotting many histograms together using facet_grid in ggplot2. However,
I want to then add a vertical line to each histogram, or facet, each of
which vertical lines are at different x-values.
The following example adds all vertical lines to each facet:
ggplot(data,aes(values)) + geom_histogram() + facet_grid(.~variable) +
geom_vline(xintercept=c(5,10,15))
How can I add a vertical
2003 Nov 27
2
Just a thought, all this "swen" stuff, this list
It seems anyone posting to this list gets a deluge (and I mean a
deluge) of virus infected windows garbage. It's basically enough to
ruin any email address you sign up to the list with; it doesn't matter
if you have a virus scanner integrated with your MTA, I really don't
want to see 200 virus notifications a day because i posted to this
list. I have been getting about 20MB of swen a
2009 Jul 24
1
ggplot question
In page http://had.co.nz/ggplot2/scale_date.html , there is a time series
plot for multiple variables at the bottom. i.e
qplot(date, value, data = em, geom = "line", group = variable) +
+ facet_grid(variable ~ ., scale = "free_y")
How can I make different color for different series?
Thanks
--
View this message in context:
2012 Mar 02
0
ggplot2 0.9.0
# ggplot2
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
complex multi-layered graphics.
Find out more at
2012 Mar 02
0
ggplot2 0.9.0
# ggplot2
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
complex multi-layered graphics.
Find out more at
2011 Oct 11
1
controling text in facets (ggplot2)
Hi R-helpers!
Here is my problem:
I have a graph with 3 different facets where there are 3 different
regression line. My goal is to mention separately in each facet each
equation that describes my lines.
So far, I managed to add a line and the same equation to all my facets but
that's not unfortunately what I want.
Is there a way to do that? Any suggestion would be gladly welcome!
Thanks