Displaying 18 results from an estimated 18 matches similar to: "ggplot2 - facet_grid and facet_wrap"
2008 Dec 03
2
ggplot2 - suggestion for facet_wrap/grid
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20081203/26bd4ac1/attachment.pl>
2009 Jan 07
1
Problem with ggplot2 - facet_wrap and boxplot
Hello R users and Hadley,
Back again with a little problem in ggplot2 =o) (ggplot 0.8.1, R 2.8.0)
Here the problem :
library(ggplot2)
df <- data.frame(id = 1:100, x1 = c(rnorm(50), rnorm(50, 1)), x2 =
c(rnorm(50), rnorm(50, 1.5)), x3 = c(rnorm(50, 0.5), rnorm(50, 2.5)), group
= as.factor(rep(c("a", "b"), each = 50)))
df.melt <- melt(df, id = c("id",
2009 Aug 11
1
ggplot2: override facet names in facet_wrap?
just a quick question (to which I suspect the answer is "no"):
does anyone know if, in the ggplot2 package, there's a way to
override the default names of the facets in facet_wrap (which
correspond to the levels of the factor used to facet)? I know
that I go back and change the levels of the factor, but it would
be convenient to be able to supply a vector of level names at
the time
2009 Oct 29
1
multiple pages with ggplot2 facet_wrap?
I currently use lattice functions to produce multiple pages of plots
using the "layout" argument to specify the number of rows and columns
of panels, e.g.,
xyplot(price ~ carat | clarity, diamonds, layout = c(2, 2))
This results in 2 pages of 4 panels each. "diamonds" is a data.frame
distributed with ggplot2.
I would like to do the same with ggplot2 but have been
2013 Feb 18
1
ggplot2 and facet_wrap help
Dear R experts,
I am trying to arrange multiple plots, creating one graph for each
size1 factor variable in my data frame, and each plot has the median
price on the y-axis and the size2 on the x-axis grouped by clarity:
library(ggplot2)
df <- data.frame(price=matrix(sample(1:1000, 100, replace = TRUE), ncol = 1))
df$size1 = 1:nrow(df)
df$size1 = cut(df$size1, breaks=11)
2017 Nov 10
1
How to create separate legend for each plot in the function of facet_wrap in ggplot2?
Hi R users,
I need to create more than 20 figures (one for each group) in one page. I
have a common legend for 20 figures using the facet_wrap. However the
range of the values among the groups are very wide. For example one group
has the value of 0 to 3, but the values of some of the groups has ranged
from 0 to 20 so that when I used a single common legend for all 20 figures,
I could not display
2008 Dec 02
1
ggplot2 facet_wrap problem
Hadley,
I don't know if I am doing something wrong or if it is ggplot please
see the two graphs at the bottom of the page (code).
melt.nut <- (structure(list(RiverMile = c(119L, 119L, 119L, 119L, 119L, 119L,
119L, 119L, 119L, 148L, 148L, 148L, 148L, 148L, 148L, 148L, 179L,
179L, 179L, 179L, 179L, 179L, 179L, 185L, 185L, 185L, 185L, 185L,
185L, 185L, 190L, 190L, 190L, 190L, 190L, 190L,
2010 Oct 28
1
ggplot2: facet_grid with only one level does not display the graph with the facet_grid level in title
Hi All,
Here is the code that I'll be referring to:
p <- ggplot(wastran.data, aes(PER_KEY, EVENTS))
(p <- p +
facet_grid( pool.short ~ .) +
stat_summary(aes(y=EVENTS), fun.y = sum, geom="line") +
opts(axis.text.x = theme_text(angle = 90, hjust=1), title="Events
(15min.) vs. Time: Facet pool", strip.text.y = theme_text())
)
Now, depending on preceding
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
2008 Jan 27
1
Putting frame around single panels in ggplot 2 and facet_grid()
Hi
I want to highlight two panels in a grid created with facet_grid() by
putting a box around it or usiong another background colour. Is this
possible, and if yes, how?
Thanks
Rainer
--
Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)
Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa
Tel: +27 - (0)21 650 5776 (w)
Fax:
2013 Nov 12
0
geom_abline does not seem to respect groups in facet_grid [ggplot2]
Just trying to understand how geom_abline works with facets in ggplot.
By way of example, I have a dataset of student test scores. These are in a data table dt with 4 columns:
student: unique student ID
cohort: grouping factor for students (A, B, . H)
subject: subject of the test (English, Math, Science)
score: the test score for that student in that subject
The goal is to compare
2016 Apr 20
0
overlay two facet_grid
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
Overlaying aesthetics is possible. Overlaying graphs is not. Without sample data, concrete examples will be unlikely to appear, so read the above link and pay attention to the dput function.
--
Sent from my phone. Please excuse my brevity.
On April 20, 2016 3:01:43 PM PDT, "ch.elahe via R-help"
2016 Apr 20
2
overlay two facet_grid
Hi all,
Does anyone know how to overlay two facet_grids? I have two facet grids as following:
ggplot(data=df,aes(x=TE,y=TR,color="orange"))+geom_point()+facet_grid(FS+TRJ~OR+INV,labeller=label_both)+xlim(0,200)+ylim(0,10000)
ggplot(data=df,aes(x=TE,y=TR))+geom_point(aes(color=TST))+facet_grid(FS+TRJ~OR+INV,labeller=label_both)+xlim(0,200)+ylim(0,10000)
Thanks for any help!
Elahe
2008 Jan 26
2
using facet_grid() from ggplot2 with additional text in labels
Hi
I am using ggplot2 at the moment and I must say it is definitely better
then ggplot - good work.
My problem is that I am using facet_grid() in the following way:
> p <- ggplot(ssq, aes(x=year, y=-log(ssq)))
> p + geom_point() + facet_grid(me*gi~cs*rz)
and it works nicely, except that I would like to have, in naddition to
the values of me, gi, cs and rz the name of the variable.
2009 Oct 02
1
ggplot2: proper use of facet_grid inside a function
Hello Again R Folk:
I have found items about this in the archives, but I?m still not getting
it right. I want to use ggplot2 with facet_grid inside a function with
user specified variables, for instance:
p <- ggplot(data, aes_string(x = fac1, y = res)) + facet_grid(. ~
fac2)
Where data, fac1, fac2 and res are arguments to the function. I have
tried
p <- ggplot(data,
2013 Sep 18
1
ggplot2: changing strip text in facet_grid and a legend text problem
Hi,
Dummy data script and scripts are attached below.
I would like to change the plot to look like this:
2011 Jan 18
2
ggplot2, geom_hline and facet_grid
Hi
I have a long data set on which I want to do Bland-Altman style plots for each rhythm type
Using ggplot2, when I use geom_hline with facet_grid I get an extra set of empty panels.
I can't get it to do it with the "Diamonds" data supplied with the package so here is a (much abbreviated) example:
> lvexs
cvd_basestudy ecd_rhythm fixed_time variable_time
1 CBP05J02
2013 Mar 06
6
Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?
Hi,
# For publications, I am not allowed to repeat the axes. I have tried to
remove the axes using:
# yaxt="n", but it did not work. I have not understood how to do this in
ggplot2. Can you help me?
# I also do not want loads of space between the graphs (see below script
with Dummy Data).
# If I could make it look like the examples on the (nice) examples page:
#