Displaying 20 results from an estimated 1000 matches similar to: "ggplot2: facet_grid with different vertical lines on each facet"
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
2013 May 14
1
Tamaño plots y calidad en grafico ggplot
Hola a tod en s,
bueno, un poco al hilo de un mensaje anterior, reformulo la pregunta y
pongo código completamente reproducible, a ver si hay más suerte.
Estoy con un informe y hay que hacer algunos gráficos con datos
diferentes con ggplot2, y hay que poner el mismo tamaño para todos
ellos.
El problema es que R cambia automáticamente el tamaño del área de
trazado y el margen en función de
2009 Aug 10
2
ggplot: colours to geom_segments
Just as an exercise I am tying to add colours to a geom_segment command. I can get one colour but not a sequence of colours.
Can anyone suggest how I can get the green lines in the plot below to be different colours? I thought I could use a palatte of colours but that did not seem to work.
Thanks
=========================================================================
library(ggplot2)
xx
2009 Oct 09
1
Placing text in a ggplot
I am attempting to graph 12 months of temperatures, delineate the months with a vline and place the names of the months at the top of the graph.
So far I have gotten everything to work except the names, despite getting a similar graph to work yesterday the day before yesterday with Baptise A's help. Can anyone suggest what I am doing wrong. Data set is below code.
Thanks.
Code
2008 Jul 03
1
ggplot2 legend for vertical lines
Dear all,
The following example code produces a graph with ggplot2, to which I
add several vertical lines of arbitrary colors. I am not satisfied
with the legend: it automatically adds some vertical lines which I'd
rather not see (they confuse the reader rather than add information
in this case).
> library(ggplot2)
> dfr <- data.frame(values = sin(1:50/10),
> fact =
2009 May 27
1
ggplot2 adding vertical line at a certain date
library(ggplot2)
melt.updn <- (structure(list(date = structure(c(11808, 11869, 11961, 11992,
12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057,
13149, 11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418,
12600, 12631, 12753, 12996, 13057, 13149), class = "Date"), variable =
structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 2L,
2020 Jun 05
3
líneas sobre un mapa
Gracias Emilio y Jorge. Tengo que explicarlo mejor. Mostrando a una
audiencia cómo hacer un tipo de análisis, se hace un loop (abajo) que
analiza un mapa por regiones longitudinales. Tal y como está el script,
print(i) te indica la longitud por la que va (de 10º en 10º) pero me
gustaría que en vez de eso te fuese representando una línea vertical sobre
el mapa, que he representado previamente con
2020 Apr 01
2
añadir líneas verticales con ggplot
Buenos días, hago un mapa con ggplot:
world<-map_data('world')
windows();ggplot(legend=FALSE) +
...
geom_point(data=Data,aes(x=lon,y=lat,color=Clst),size=1.25) +
scale_color_manual(values=c("grey45","navy","skyblue","gold","green3","darkgreen"))
+
geom_path( data=world, aes(x=long, y=lat,group=group)) +
labs(title =
2020 Jun 05
2
líneas sobre un mapa
Buenos días ¿sabéis si hay alguna forma de añadir una recta vertical sobre
un mapa hecho previamente con ggplot? Lo que hago ahora es cargar
nuevamente el mapa con la línea añadida (una serie de líneas añadidas
secuencialmente en un loop) pero me gustaría que añadiese las líneas sin
cargar nuevamente el mapa.
Gracias,
Manuel
[[alternative HTML version deleted]]
2005 Aug 03
1
passing variable to formula environment
List gurus,
I'm trying to code a Gompertz growth curve function as part of a larger
project and have run across a problem due to my ignorance of
environments. Some sample data and the function are as follows:
growth <- data.frame(age = c(1.92, 3, 5.83, 3.17, 15.5, 1.17, 5.58,
13.33, 14.29, 5.83, 13.79, 6.33, 13.75, 16.83, 13, 11.67, 0.25, 1.73,
9.46, 5.67), length = c(157, 165, 179,
2013 Oct 11
1
behaviour of read.xls (gdata package) when worksheet usesuser-defined cells formats
(I'm afraid this post didn't reach the list on last Wednesday, here it is again )
hi R-list,
And sorry for my frenglish !
I am running R < Good Sport > release ( i386-w64-mingw32/i386 (32-bit) ) ) under Windows 7 Professional, Service Pack 1.
My perl executable is ActivePerl build 817 [257965] (i.e. version 5.8.8.817). Usually it is working fine.
Using the gdata ::read.xls
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
2008 Aug 07
2
lattice: add vertical lines in xyplot
Hi list,
This is a very basic question about lattice: I wish to add some
vertical lines in each panel of a xyplot as demonstrated in this
example:
> library(lattice)
>
> xx <- seq(1, 10, length=100)
> x <- rep(xx, 4)
> y <- c(cos(xx), sin(xx), xx, xx^2/10)
> fact <- factor(rep(c("cos", "sin", "id", "square"), each=100))
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 Mar 04
1
ggplot2 - Problem with grid plot
Hi R-help
I'm trying to create a grid plot in which each plot in the grid contains two
density plots (colored by factor) and two vertical lines at the respective
medians (also colored by the factor).
Using the diamonds dataset as an example, the following commands give me
price density plots by factor cut in a single, ungridded plot.
p <- ggplot(data=diamonds, aes(x=price)) +
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"
2013 May 13
0
Tamaño plots y retoques de ticks en grafico ggplot
Hola a tod en s,
estoy con un gráfico algo complicado de ggplot y me he quedado
bloqueado con un par de cosas.
Si se ejecuta el siguiente código, se obtiene el gráfico que pongo a
continuación.
Necesitaría que en la línea sombreada de color azulado, correspondiente
a Alpha (252), esta etiqueta "Alpha (252)" también saliese sombreada o,
al menos, destacada con otro color y en
2011 May 18
1
Changing order of facet grid in ggplot2
Hi I am running the following code:
sym <- c(sym1,sym2,sym4)
lifedxm <- c("O-BD","O-WELL","O-UNI")
life <- c(lifedxm,lifedxm,lifedxm)
tp <- c("TP-ANY","TP-ANY", "TP-ANY", "TP-SUB", "TP-SUB", "TP-SUB", "TP-CLIN"
, "TP-CLIN", "TP-CLIN")
data <-
2008 Dec 14
0
New version of ggplot2, 0.8.1
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
2008 Dec 14
0
New version of ggplot2, 0.8.1
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