similar to: Order of factors with facets in ggplot2

Displaying 20 results from an estimated 3000 matches similar to: "Order of factors with facets in ggplot2"

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
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
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
2013 May 11
3
boxplot with grouped variables
my dataset looked like this in the beginning: >Daten V1 V2 V3 1 Dosis Gewicht Geschlecht 2 0 6.62 m 3 0 6.65 m 4 0 5.78 m 5 0 5.63 m I need box plots for V2 with all combination of V1 and V3, so I deleted the first row, and tried this: boxplot(Daten$V2[Daten$V3=="m"]) but it does not work and I
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",
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
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
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,
2010 Aug 23
2
change order of plot panels in faceted ggplot/qplot
Hi, I have a 5-paneled figure that i made using the facet function in qplot (ggplot). I've managed to arrange the panels into two rows/ three columns, but for the sake of easy visual comparisons between panels in my particular dataset, I want to have the two plots on the bottom align on the right hand side of the figure instead of the left. Here's an example: m <-
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
2018 Jan 19
0
Split charts with ggplot2, tidyquant
Hi Charlie, Thanks. This is helpful. As mentioned in my original question, I want to be able to plot a few such charts on the same page, say a 2 x 2 grid with such a chart for each of 4 different stocks. Using your solution I accomplished this by making a list pLst of your ggplots and then calling cowplot::plot_grid( plotlist=pLst, nrow=2, ncol=2 ) That worked fine. The one issue I have is that
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
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
2013 Jan 31
1
facet plot
Hi all, I want to plot a facet plot with column names as x and column values as y. One plot for each row. here is part of my dataset: Gene T0h T0.25h T0.5h T1h T2h T3h T6h T12h T24h T48h NM_001001130 68 95 56 43 66 62 68 90 63 89 NM_001001144 0 1 4 0 1 1 1 4 1 2 NM_001001152 79 129 52 50 24 45 130 154 112 147 NM_001001160 1 1 2 0 0 1 0 0 0 1 NM_001001176 0 0 0 0 0 0 0 0 0 0 NM_001001177
2008 Feb 27
1
how to specify ggplot2 facet plot order
Hi, new to R and ggplot2. I've been trying to get a facet plot in which the order of the facets is as I require, rather than ordered numerically, alphabetically, by Roman numerals, mean (answers to these were posted here after much searching). Here's some test code to demonstrate what I get. series = c('C2','C4','C8','C10','C15','C20') ids =
2018 Mar 12
2
ggplot and boxplots
Hi, I was wondering if someone could give me a hint or two. I'm having problems generating ggplot2 boxplots . The plot that is has dots but no boxplots. Below is the dataset > testing_ggplot V1 V2 V3 1 256 Disabled 688.61 2 256 Disabled 698.63 3 256 Disabled 700.02 4 256 Disabled 693.36 5 256 Disabled 688.8 6 256 Disabled 697.72 7 256 Disabled 698.15 8 256
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
2018 Jan 20
2
Split charts with ggplot2, tidyquant
For this kind of control you will probably need to move to base graphics and utilize the `fig` argument in par(), in which case you would want to run the plot() command twice: once with your first outcome and once with your second, changing the par() settings before each one to control the size. On 01/19/2018 01:39 PM, Eric Berger wrote: > Hi Charlie, > Thanks. This is helpful. As
2011 Aug 10
1
Sequential Naming of ggplot .pngs using plyr
If I have data: dat<-data.frame(a=rnorm(20),b=rnorm(20),c=rnorm(20),d=rnorm(20),site=rep(letters[5:8],each=5)) And want to plot like this: ctr<-1 for(i in c('a','b','c','d')){ png(file=paste('/tmp/plot_number_',ctr,'.png',sep=''),height=8.5, width=11,units='in',pointsize=9,res=300) print(ggplot(dat[,names(dat) %in%
2011 Jun 08
3
How to suppress factor labels
I am using ggplot2 to make a boxplot that overlays a scatterplot: pp = qplot(time, error, data=times, size=I(1), geom="jitter", main=title, ylab="Error (min)", xlab="Time before ON (min)", alpha=I(1/10), color=times$runway, ylim=c(-30,40)) pp2 = pp + with(times, facet_wrap(~ runway, ncol=2)) print(pp2 + geom_boxplot(alpha=.5,