similar to: Setting scales for ggplot2 with facets

Displaying 20 results from an estimated 2000 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 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,
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
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'
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 =
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 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
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
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
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
2009 Nov 22
1
"Over-coloring" facets on persp() plot
Dear R Community: Recently, I have managed to plot some really useful graphs of my research data using persp(). I have even figured out how to overplot rectangular regions (corresponding to submatrices) with a different color. This is accomplished by using par(new=T). I am now searching for a way to "highlight" a set of (possibly non-contiguous) facets with a specific color,
2011 Feb 10
1
Ggplot: free x-scales in a facet-grid
Hello, I have a ggplot that has the looks of the plot that I want, but it doesn't have the right layout. The data is an ordered melted dataframe: - ID - type (to use for a faced grid) - time - type - time - value (POSIXct) - pos (to use for a faced grid, this is an index to split the plot) The goal of the plot is to create a time line for each ID (different points of time). The ID's
2009 Feb 11
2
Label bars in a faceted bar plot in ggplot2
Hi List, I am running R 2.8.0 on a Windows XP machine, running ggplot2 version 0.8.1 I want to label the bars in a faceted grid barplot. Reproducible R code is given below: #### reproducible facet barplot ##### library(ggplot2) # Dataset from which to create the barplot ml <- rep(1:10,2) vals <- rnorm(20,mean = 10, sd=1) type <- c(rep("MAPE",10),rep("AIC",10))