search for: coord_flip

Displaying 20 results from an estimated 63 matches for "coord_flip".

2011 Dec 04
1
Polishing my geom_bar for publication
...quot;WINTER","SPINYTAIL","BIGELOW'S","SKATES (NS)","THORNY","SMOOTH","ABYSSAL","LITTLE","DEEPWATER","JENSEN'S","WHITE","SOFT")) + ylab("Abundance (fish/tow)") + coord_flip() + theme_bw() + opts(axis.title.x = theme_text(size = 10)) + opts(panel.grid.minor = theme_blank()) + opts(legend.position='none') ) (b<-ggplot(Final2, aes(x=spp, y=WPUE, fill=season)) + geom_bar(position=position_dodge()) + geom_errorbar(aes(ymin=WPUE-wpue.se, ymax=WPUE...
2012 Dec 21
2
ggplot2: setting martin
Is it possible to set the margin in ggplot2 to a fixed size? I create many plots, and I want them to look the same. Especially I want them to have the same left margin. But P<-ggplot()+geom_bar(aes(c("short label1","short label2"),runif(2)))+coord_flip() P<-creates a plot with another margin as ggplot()+geom_bar(aes(c("very very very very long label1","short label2"),runif(2)))+coord_flip() In the standard plot system margins can be set with par(mar=c(...)), but this doesn't work in ggplot2 I thought I could do...
2010 Aug 11
2
help to polish plot in ggplot2
...;- rnorm(10, mean=12, sd=10) mydat <- data.frame(category,grp1,grp2,grp3,grp4) dat.m <- melt(mydat) p <- qplot(1,value, data=dat.m, geom="bar", xlab="",ylab="Percentage of eco change",stat="identity",fill=variable, position="dodge") p + coord_flip()+ facet_grid(category ~ ., space="free")+scale_x_discrete(breaks=c(2,4))+opts(strip.text.y = theme_text(hjust = 0)) Now the only modification I need from this plot is that I want the grid labels (text) on the left hand side with right justification and white background. My prospective...
2011 Aug 29
1
Legend / bar order - ggplot2
...(letters[1:10], 2), levels = letters[1:10]), type = factor(c(rep("orig", 10), rep("match", 10)), levels = c("orig", "match"))) ggplot(df, aes(x = name, y = value, fill = type)) + geom_bar(position = position_dodge()) + coord_flip() Thank you very much, YL
2010 Sep 01
2
ggplot2 multiple group barchart
...(3,5,7,2,9) gender <- c("m","f","m","f","f") d.data <- data.frame (v1, v2, v3, gender) d.data x <- names (d.data[1:3]) y <- mean (d.data[1:3]) pl <- ggplot (data=d.data, aes (x=x,y=y)) pl <- pl + geom_bar() pl <- pl + coord_flip() pl <- pl + geom_text (aes(label=round(y,1)),vjust=0.5, hjust=4,colour="white", size=7) pl this gives me a nice barchart to compare the means of my variables "v1","v2" and "v3". my question: how do i have to proceed if i want this barchart splittet by t...
2011 Dec 23
1
simple ggplot2 question
...'free_y' would do the trick. I also tried converting variable place into class 'factor'. require(ggplot2) DF <- data.frame(place=letters, value=runif(26), location=c(rep(1, 13), rep(0, 13))) qplot(data=DF, x=place, y=value, geom="bar", stat="identity") +   coord_flip() +   geom_abline(intercept=35, slope=0, colour="red") +   facet_grid(location ~ ., scales="free_y") R.version.string # "R version 2.10.1 (2009-12-14)" Thank you in advance & merry xmas!   Cheers!! Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
2010 Jun 30
2
ggplot qplot bar removing bars when truncating scale
...(data=data,data$Q,data$mean,fill=data$variable,geom="bar",stat="identity",position="dodge",binwidth=2,ylab=NULL,xlab=NULL,width=.75) #With 0-6 Scale p + scale_x_discrete(expand=c(0,0)) + scale_y_continuous(limits=c(0,7),breaks=seq(from=0,to=6,by=.5),expand=c(0,0)) + coord_flip() + scale_fill_manual(values=c("darkmagenta","lightgoldenrod1")) + opts( panel.background = theme_rect(colour = NA), panel.background = theme_blank(), panel.grid.minor = theme_blank(), axis.title.x= theme_blank(), axis.title.y= theme_blank(), axis.text.y=them...
2012 Jun 06
5
ggplot incorrect legend
How do I create a legend with ggplot? I think should be getting the FuelTypeNum in the legend. Plot: http://r.789695.n4.nabble.com/file/n4632471/Rplot.jpeg My code is: ggplot(data=tempTable, aes(x=Bands8, y=SubPercent, fill=FuelTypeNum)) + geom_bar(position="stack", stat="identity") + scale_colour_hue('my legend', breaks = levels(tempTable$FuelTypeNum),
2013 Oct 30
1
ggplot2 - how to get rid of bar boarder lines
...lotdata, aes(x=att_levels, y=WTP)) + geom_bar(stat="identity",fill="dark orange",colour="black", alpha = 1,position = "identity") + geom_text(aes(label=WTP),colour="black",size=4,hjust=1.1,position='dodge') + coord_flip() + xlab("") + ylab("") How could I get rid of the border lines on the bars (just leave the fill, but no border)? Thank you! -- Dimitri Liakhovitski [[alternative HTML version deleted]]
2020 Nov 24
2
Cambiar nombre de topic en análisis LDA
...4)) lda22 %>% tidy() %>% group_by(topic) %>% top_n(10, beta) %>% ungroup() %>% mutate(term = reorder_within(term, beta, topic)) %>% ggplot(aes(term, beta, fill = factor(topic))) + geom_col(show.legend = FALSE) + facet_wrap(~ topic, scales = "free_y") + coord_flip() + scale_x_reordered() Muchas gracias
2013 Jul 25
1
GGplot 2 – cannot get histogram and box plot axis to match.
...aVector) graphRange <- c(min(dataVector) - dataRange/5, max(dataVector) + dataRange/5) #making the box plot theBoxPlot <- ggplot(dataSet,aes_string(x = "MPG.city",y = "MPG.city")) theBoxPlot = theBoxPlot + geom_boxplot() + expand_limits(y= graphRange) + coord_flip() print(theBoxPlot) #making the histogram thePlot <- ggplot(dataSet,aes_string(x = "MPG.city")) thePlot <-thePlot + geom_histogram() + expand_limits(x= graphRange) print(thePlot) Thank you for taking the time to read this. John Clow UCSB Student
2010 Oct 19
3
plot CI and mortality rate
Dear R Users: I have the individual mortality rate and 95% CI of 100 hospitals, how to do the plot with the individual hospital in the Yaxis, and the mortality rate and 95% CI in the Xais and a overall mean as a reference line? Thanks and regards, Xin [[alternative HTML version deleted]]
2011 Jul 26
1
adjusting x-axis labels
I am trying to tweak how my categorical x-axis labels are formatted in my bar graph. Specifically, I would like to a) decrease the spacing between lines (e.g. spacing between Dialium and guianensis) b) right justify the text and c) have each species name align with the center of the corresponding bar graph. A simplified version of my code thus far is as follows. I am using RStudio v.
2013 Oct 30
1
ggplot2 question: keeping the order as in the input data
...lotdata, aes(x=att_levels, y=WTP)) + geom_bar(stat="identity",fill="dark orange",colour="black", alpha = 1,position = "identity") + geom_text(aes(label=WTP),colour="black",size=4,hjust=1.1,position='dodge') + coord_flip() + xlab("") + ylab("") -- Dimitri Liakhovitski [[alternative HTML version deleted]]
2023 Feb 21
2
Problem of intercept?
...ntity",position="dodge")+ ? scale_fill_discrete(name="Model", ? labels=c("Multiple", "Simple"))+ ? labs(title =paste('La diff?rences des coefficients ? entre la r?gression multiple et simple'), ? x="Models",y="Coefficient")+ ? coord_flip() ? ? ?
2010 Jun 10
1
Order labels in qplot() - ggplot2 {help}
...t;) p <- c(2, 2,1, 3,5) pm<- c(3,4,2,5,4) pn <- c(1,1,1,2,3) x<-data.frame(cbind(n,p,pm,pn)) library(ggplot2) qplot(x=n, y=p, data=x, ymin=pn, ymax=pm, xlab='', ylab='', main='Order Label as: va vp a b c') + geom_hline(yintercept = 2) + geom_linerange() + coord_flip() Thanks! [[alternative HTML version deleted]]
2007 Jun 22
1
Switching X-axis and Y-axis for histogram
Dear all, I'm creating a histogram with the function hist(). But right now what I get is column representation (as normal). I'm wondering if I could switch X-axis and Y-axis and get row-representation of frequencies? One more question, can I define the step of each axises for the histogram? Thanks so much! Donghui
2009 Apr 27
1
plot estimates and their 95% confidence intervals
Hi, there: I have a dataset with 50 states and for each state, I have its associated mean estimate (for some parameters) and the lower and upper bound of the 95% CI. The data look like below: state ami_mean ami_low ami_up 1 MS -0.58630 -0.90720 -0.29580 2 KY -0.48100 -0.75990 -0.19470 3 FL -0.47900 -0.62930 -0.32130 I would like to have a plot the 95% CI (characterized by
2009 Jul 24
0
GGPlot 2 and odfweave
Hi John: Use print before qplot or ggplot. Something like this: <<TV,fig=TRUE,echo=FALSE>>= print(qplot(subscriber,data=TV09,geom="bar",fill=subscriber, xlab=NULL,ylab=NULL)+coord_flip()+ opts(legend.position="none")) @ Felipe D. Carrillo? Supervisory Fishery Biologist? Department of the Interior? US Fish & Wildlife Service? California, USA > --- On Fri, 7/24/09, John Lipkins <john.lipkins at googlemail.com> > wrote: > > > Fro...
2012 Jan 29
1
ColorBrewer question
...changes to the default. I tried several places of "+ scale_colour_brewer(type="seq", pal = "Blues")" with no effect. This is my code:   p <- ggplot(data, aes(x = gender))  + scale_y_continuous("",formatter="percent") + xlab("Gender") + coord_flip() +     scale_colour_brewer(type="seq", pal = "Blues") p+geom_bar(aes(fill=pet),colour='black',position='fill')     Any ideas welcome. Thanks,  Mario [[alternative HTML version deleted]]