search for: theme_text

Displaying 20 results from an estimated 45 matches for "theme_text".

2011 Aug 31
2
ggplot2 to create a "square" plot
Dear all, I am using ggplot with geom_tile to print as an image a matrix  I have. My matrix is a squared one of 512*512 cells.  The code that does that is written below > print(v + geom_tile(aes(fill=dB))+ opts(axis.text.x=theme_text(size=20),axis.text.y=theme_text(size=20), axis.title.x=theme_text(size=25) , axis.title.y=theme_text(size=25), legend.title=theme_text(size=25,hjust=-0.4) , legend.text=theme_text(size=20)) + scale_x_continuous('km')  + scale_y_continuous('km')    ) as you can see from the pictu...
2009 Mar 05
1
is there any option like cex.axis in ggplot2?
Dear list,   I made boxplots using ggplot and want to control for x- and yaxis. Using "plot" I can do it by setting cex.axis equally to any size but can't figure out how to do it with ggplot.     ggplot(dat, aes(x = factor(time), y = volume)) + opts(axis.title.x=theme_text(size=8),axis.title.y=theme_text(size=8)) + geom_boxplot() + geom_jitter(aes(colour = id))+labs(x = "time", y = volume)   Thanks for your help,   Tom     __________________________________________________________ Går det långsamt? Skaffa dig en snabbare bredbandsuppkoppling. Sök o...
2011 Jun 21
2
qplot/ggplot2 Questions
...KWard","Revolution Analytics","R Commander","Rattle GUI","ESS (Emacs Speaks Statistics)","Tinn-R","RapidMiner R extension","Eclipse with StatET","Rstudio","Built-in R console")) q<-q+opts(axis.text.x = theme_text(colour = "black", size = 12)) q<-q+opts(plot.title = theme_text(colour = "black", face="bold", size = 16, vjust=2)) q<-q+opts(axis.text.y = theme_text(colour = "black", hjust=1)) q<-q+opts(axis.title.y = theme_text(face= "bold", size= 12, a...
2009 Jan 24
2
ggplot2 - how to change location / position of wind rose axis labels?
...et, 4), labels = 1:4) doh <- ggplot(movies, aes(x = rrating, fill = budgetq)) doh + geom_bar(width = 1) + coord_polar() #Now with my theme (hacked from theme_bw) getting close to what I need theme_bwdn<-function (base_size = 12) { structure(list(axis.line = theme_blank(), axis.text.x = theme_text(size = base_size * 1, lineheight = 0.9, vjust = 1), axis.text.y = theme_blank(), axis.ticks = theme_segment(colour = "black", size = 0.2), axis.title.x = theme_blank(), axis.title.y = theme_blank(), axis.ticks.length = unit(0, "lines"), axis.ticks.margi...
2011 Aug 24
1
Scatter plots, linear regression in ggplot2
...yvar = 1:20 + rnorm(20,sd=3)) ggplot(df, aes(x=xvar, y=yvar, shape=cond)) + scale_shape_manual(values=c(1,2)) + geom_smooth(method = "lm", se=FALSE) + theme_bw()+ geom_point(size = 5)+ opts(title = "Xvar vs. Yvar", plot.title = theme_text(face="bold", size=16), axis.text.x = theme_text(angle=90), axis.title.x = theme_text(face="bold", size=12), axis.title.y = theme_text(face="bold", size=12, angle=90), panel.grid.major = theme_blank(), # switch off major gridlin...
2010 Jun 30
2
ggplot qplot bar removing bars when truncating scale
...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=theme_text(size=12,hjust=1), legend.text=theme_text(size=14) ) #With 3-6 Scale (Bars Deleted) p + scale_x_discrete(expand=c(0,0)) + scale_y_continuous(limits=c(3,6),breaks=seq(from=3,to=6,by=.5),expand=c(0,0)) + coord_flip() + scale_fill_manual(values=c("darkmagenta","lightgoldenrod1&q...
2009 Dec 11
1
ggplot: Problem with legend background
...repFrame <- data.frame(A= 1:10, B= rnorm(1:10), groupNum = rep(c("First group", "Second group"),each=5)) testPlot <- ggplot(repFrame, aes(x=A, y = B, group = groupNum)) + opts(legend.position=c(0.85,0.3), legend.background = theme_rect(fill="white"), legend.text=theme_text(size=16), legend.title=theme_text(size=20)) testPlot + geom_point(aes(colour= groupNum)) As you can see, the text doesn't fit in the white rectangle. I suspect there is a theme setting I could modify to fix this, but I can't seem to find which one. I sincerely thank you for your time and...
2010 Feb 08
1
R ggplot2 legend text left justify
In ggplot2 how do you justify the legend text ? In the example below the opts(legend.text = theme_text(size = 9,hjust=0)) changes the size of the text OK but it remains right justified. > mydata=data.frame(RowID=c("A","B","C"),Name=c("long long long long long name","short name ","medium medium name"),Speed=c(100,140,120)) > my...
2011 Dec 04
1
Polishing my geom_bar for publication
...W'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+wpue.se), size=.3,...
2011 Nov 08
3
ggplot2 reorder factors for faceting
...7", high="#CA0020", midpoint=0, breaks=NULL, labels=NULL, limits=NULL, trans="identity") # set up text (size, colour etc etc) hp2 <- hp2 + labs(x = "Time", y = "") + scale_y_discrete(expand = c(0, 0)) + opts(axis.ticks = theme_blank(), axis.text.x = theme_text(size = 10, angle = 360, hjust = 0, colour = "grey25"), axis.text.y = theme_text(size=10, colour = 'gray25')) hp2 <- hp2 + theme_bw() In the resulting plot I would like infections infA and infC plotted next to each other and likewise for infB and infD. I have a column in the d...
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 parameters, the 'pool.short' factor variable in 'wastran.data' can have one distinct factor level or it can have more than one. When 'pool....
2013 Apr 18
1
Arranging two different types of ggplot2 plots with axes lined up
...03,2003,2003,2003,2003,2003,2003,2003, 2004,2004,2004,2004,2004,2004,2004,2004,2004,2004) fc<-sample(1:1000, 50) yfc<-data.frame(year2, fc) #make test precipitation plot yp_plot<-ggplot(yp) + geom_point() + geom_line() + aes(year, y=precip) + opts(title="Site X \n ", axis.text.x=theme_text(angle=45, hjust=1, vjust=1)) + ylab("Annual Precipitation (in.) \n ") + xlab("") #make test fecal coliform plot yfc_plot<-ggplot(yfc) + geom_boxplot() + aes(x=as.factor(year2), y=fc) + opts(axis.text.x=theme_text(angle=45, hjust=1, vjust=1)) + xlab(" \n Date") + yl...
2011 Jan 06
1
Help spruce up a ggplot graph
Given the data structure below and the call to ggplot2, how can I increase the size of the axis scale points, the line weight, and the size of the legend? ddata <-structure(list(year = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("2003", "2007"), class = "factor"), area = structure(c(7L, 6L, 1L, 2L, 3L, 4L, 5L, 7L, 6L, 1L,
2011 Apr 03
1
another question on shapefiles and geom_point in ggplot2
...= "Número\nde\nespecies", breaks = c(2, 4, 6, 8, 10, 12, 14, 16, 18, 20)) +  scale_colour_gradientn(name = 'Número\nde\nespecies',  colours = rainbow(6), breaks = c(2, 4, 6, 8, 10, 12, 14, 16, 18, 20))+  xlab("Longitud") + ylab("Latitud") + opts(axis.text.x = theme_text(size = 8, vjust = 1)) +  opts(axis.text.y = theme_text(size = 8, hjust = 1))        Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx > >From: Manuel Spínola <mspinola...
2010 Mar 09
1
ggplot2 rose diagram
Dear R gurus - consider this plot: library(ggplot2) dat <- sample(1:8,100,replace=TRUE) smp <- ggplot(data.frame(dat), aes(x=factor(dat),fill=factor(dat))) + geom_bar(width=1) smp + coord_polar() Q1. How do I change the font size and weight of bar labels (1,2,3...)? I've been wallowing in the 'Themes' structure and I just can't figure out the correct place to change
2012 Feb 06
1
ggplot2 geom_polygon fill
...I don't desire such borders, only the as of yet unattainable fill. Here's my code: library(ggplot2) library(plyr) # define good looks no_margins <- opts( axis.line = theme_blank(), axis.text.x = theme_blank(), axis.ticks = theme_blank(), axis.title.x = theme_text(size = 12, vjust = 0.15), axis.title.y = theme_text(angle = 90, size = 12, vjust = 0.2), axis.ticks.length = unit(0, "cm"), axis.ticks.margin = unit(0, "cm"), panel.background = theme_blank(), panel.grid.major = theme_blank(), panel.grid.minor = theme_blank(), p...
2010 Aug 11
2
help to polish plot in ggplot2
...- 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 plot should have labels like the the plot generated by the codes below. The reason why I don't like the plot be...
2010 Jan 04
0
ggplot2 = bar size
Hi, i am newbie into ggplot and i thow that i have to learn a lot about this package. I am doing this function to draw an graphic: library(ggplot2) posx <- theme_text(angle=45,hjust=1,face='bold',size=12) posy <- theme_text(angle=0,hjust=1,face='bold',size=12) y1 <- c(1,4,6,1,8,10,6,1,5,4) x <- qplot(x=factor(paste('nomes',1:10),labels=paste('nomes',1:10)), y= y1 , geom='bar',margins=F, stat="id...
2009 Jan 07
1
Fw: Re: R Stacked Histogram
...work? Right now the title is obscured by the plot > and my boss will be none too happy. Thanks again. Yes, that's a really stupid bug that I accidentally introduced in the latest version. You can fix it with: qplot(mpg, wt, data = mtcars, main = "My title") + opts(plot.title = theme_text(vjust = 0, size = 16)) or by adding a new line to the end of the title: qplot(mpg, wt, data = mtcars, main = "My title\n") Regards, Hadley -- http://had.co.nz/
2010 May 16
1
problem with making multiple plots (geom_pointrange) in a loop (ggplot2)
...lect)) + ylab("Precipitation (mm)\n") + opts(title = paste("Projected Precipitation 2030 - 2049 (Sub-Basin ", subbasin_select, ")\n", sep = "")) + scale_colour_grey() p + geom_pointrange(linetype = 2, colour = "navyblue") + opts(axis.text.x = theme_text(colour = "black")) + opts(axis.text.y = theme_text(colour = "black")) + opts(axis.ticks = theme_segment(colour = "white")) ggsave(paste(subbasin_select,"2100.jpeg", sep = " ")) } dev.off() Unfortunately, I get this error: "Saving...