similar to: Is it possible to rearrange the facets in ggplot while keeping everything else the same?

Displaying 20 results from an estimated 5000 matches similar to: "Is it possible to rearrange the facets in ggplot while keeping everything else the same?"

2010 Sep 11
1
Setting scales for ggplot2 with facets
Faceting in ggplot2 seems to permit different scales for different facets, but I fail to see how one could control ylim and xlim ranges for each facet separately. For instance, I would like to set the ylim = c(0,10) for facet "A" and ylim = c(42,102) for facet "B". Since the data is out of these ranges, setting facet_grid(factor ~ ., scales = "free_y") does not
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,
2007 Nov 08
1
ggplot2 facets as rows and columns
Does anyone (Hadley??) know if there's a straightforward way in ggplot2 to get data divided by a single factor to plot as a rectangular grid of subplots? So far I've only been able to get such data plotted as a single row or single column of skinny subplots. The code below gives an example implemented with lattice, and my best attempt in ggplot2 cheers Ben Bolker ------------ g=
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
2008 Mar 25
2
ggplot2 - facetting
Dear All, After having overcome the issue of legends (thanks, Thierry, once more), I am trying to use facetting, but here also I can not find how to do this. I do not want to use qplot, but rather the more flexible options. However, it seems I am doing still something pretty stupid, because I always get an error, even if it seems I am doing everything like the examples. My code is below.
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
2010 May 06
1
How do I plot geoms in parallel in ggplot
Hello, I am new to ggplot. Please forgive my ignorance! I have patient data such that each individual is a row and then the attributes are in columns. So for example: Subj Time Height Weight WBC Plt 1 1 9 4 4 150 1 2 10 5 6 200 1 3 11 6 5 250 1 4
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,
2013 Jan 24
1
Insert segment only on particular facets in ggplot
Dear R users, I am working on a data-set with 3 species. They are apple, orange and banana. I want to annotate the facets only on the bottom panel. However, by default I am getting annotations on all the plots. I was able to get text annotation only on the desired plot. However, I am confused what I need to do for the arrows / segments. Here is my code: library(ggplot2) library(grid) tempobs
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:
2013 Mar 14
0
Fw: showing ratio in ggplot bar plot with facets
Dear R help members, I have constructed a bar plot using ggplot, where I am showing the number of particles in 10m depth bins (from 0-150m) by release area (3 different ones) and Model (also 3 different ones). My problem is that for each release area a different number of particles was released (say 35, 45 and 56). I now need to be able to show the number of particles in each depth bin
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 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
2008 Jun 17
1
ggplot facet spacing, wrapping
I'm running into some problems with the spacing of some faceted ggplot plots. I have a number of time series faceted to be one above another, but the scale labels of the y axes all clobber each other at the bottom/top of each. for example, try: qplot(x, y, data = data.frame(x = 1:10, y = 1:10, size = 1:10), facets = size ~ ., size = size) + scale_x_continuous(breaks = 1:10) +
2009 Feb 26
1
gplot problems with faceting
Dear R-Listers, I am very confused with what seems to be a misuse of the faceting options with gplot function and I hope you might help me on this. z contains various simulation results from simulations with different set of parameters. I melt my data to have the following data.frame structure : > str(z) 'data.frame': 12383 obs. of 5 variables: $ vID : num 1 2 3 4 5 6 7 8
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>
2007 Oct 30
1
Facets and/or Nested Describes
I have to confess that I did not know about facets before reading Ashley Moran''s post: http://aviewfromafar.net/2007/10/21/quick-and-dirty-facets-in-rspec-trunk Not knowing about the facets solution, I made a couple of feature requests for nested describes: http://rubyforge.org/tracker/index.php?func=detail&aid=14980&group_id=797&atid=3152
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
2011 Jan 10
1
Basic ggplot question
Hello R-Group, I am trying plotting simple time-series with ggplot2 because the output looks better and I've heard its richer in features. I have the following dataset. > dput(dat) structure(list(Date = structure(c(14970, 14971, 14972, 14973, 14974, 14977, 14978, 14979, 14980, 14981), class = "Date"), Close = c(5998.1, 5996, 6060.35, 6101.85, 6134.5, 6157.6, 6146.35, 6079.8,
2008 Oct 13
1
ggplot faceting like lattice | variable
I would like to be able to do the xyplot in ggplot below. I read in the archive that Hadley was working on this for the next release, and I can not find the documentation (Aug. 23rd). River.Mile <- c(215 ,202, 198, 190, 185, 179, 148, 119, 61) Cu <- rnorm(9) Fe <- rnorm(9) Mg <- rnorm(9) Ti <- rnorm(9) Ir <- rnorm(9) r <- data.frame(River.Mile, Cu, Fe, Mg, Ti, Ir) z <-