Re: [R] Multiple Plots using ggplot

2015-03-31 Thread John Kane
)) + geom_histogram( position="dodge", stat = "identity", aes(fill = variable)) ## John Kane Kingston ON Canada > -Original Message- > From: ntfr...@gmail.com > Sent: Tue, 31 Mar 2015 16:55:56 +0300 &

Re: [R] Multiple Plots using ggplot

2015-03-31 Thread stephen sefick
The error message is very informative. You named a column in the melted data "Start", and told ggplot to use "start". "start" is a function. R is case sensitive. On Tue, Mar 31, 2015 at 8:46 AM, Frederic Ntirenganya wrote: > Hi All, > > Thanks for the help. I want to plot some of the columns on

Re: [R] Multiple Plots using ggplot

2015-03-31 Thread Frederic Ntirenganya
Hi John, Sorry for the mistake I made for providing useless data. Here I am interest only on Tmin and Tmax columns. I want to use the same approach with the previous data. I want to plot on the same graph not separate graph. Thanks > dput(head(BUTemp))structure(list(Year = c(1971L, 1971L, 1971L,

Re: [R] Multiple Plots using ggplot

2015-03-31 Thread Frederic Ntirenganya
Hi All, Thanks for the help. I want to plot some of the columns on the same graph not all of them. Sorry, I failed to follow the instructions. Here is the output of *dput()* but I don't know how it works. > dput(head(data))structure(list(Date = structure(c(-6575, -6209, -5844, -5479, -5114, -4748

Re: [R] Multiple Plots using ggplot

2015-03-31 Thread John Kane
7977758355, 0.439361470235051, 1.2597110753159, -0.795425331570368, 0.974654694801041, -0.309087884123705, -1.55929705211554, 0.147715827800676, -0.542626171203849, 0.745294589678554, -0.254290052908619, 0.939894889209173)), .Names = c("xx", "yy", "zzrnorm.20."), row.name

Re: [R] Multiple Plots using ggplot

2015-03-31 Thread stephen sefick
Your data and post is still not provided in one of the formats provided here: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. I am unsure of what you want to do, but I have made a reproducible example that might help. zz <- "Date Number.of.Rain.Days Total.rai

Re: [R] Multiple Plots using ggplot

2015-03-31 Thread Jeff Newmiller
By failing to take the advice given to you, you make it harder to help you. Learn to control your email program to send plain text, and learn to use the dput function. With regard to this function call: > ggplot(df2, aes(Date,value)) + I highly recommend using named parameters in the aes call.

Re: [R] Multiple Plots using ggplot

2015-03-31 Thread Frederic Ntirenganya
Hi All, Sorry for the shape of data which was not good enough.This is how my data look like. I want to plot multiple using ggplot function from a data frame of many columns. I want to plot only Start.of.Rain..i., Start.of.Rain..ii. and Start.of.Rain..iii. and I failed to make it. What I want is

Re: [R] Multiple Plots using ggplot

2015-03-30 Thread Jeff Newmiller
This is no better because (a) you are still posting using HTML format, and (b) using printed output loses the internal representation of the data. The dput function is very helpful for solving this. [1] [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example --

Re: [R] Multiple Plots using ggplot

2015-03-30 Thread Frederic Ntirenganya
Hi Stephen, Sorry, the data came in bad way. Here is the head of the data. > head(data)Date Number.of.Rain.Days Total.rain Start.of.Rain..i. > Start.of.Rain..ii. Start.of.Rain..iii. Start.Rain..iv. 1 1952-01-01 86 1139.95292 239 11

Re: [R] Multiple Plots using ggplot

2015-03-30 Thread stephen sefick
Hi Frederic, Can you provide a minimal reproducible example including either real data (dput), or simulated data that mimics your situation? This will allow more people to help. Stephen On Mon, Mar 30, 2015 at 8:39 AM, Frederic Ntirenganya wrote: > Dear All, > > I want to plot multiple using g

Re: [R] Multiple plots and postscripts using split function

2014-08-02 Thread William Dunlap
Have you tried using the merge() function? E.g., lapply(split(d, d$NAME), function(di)merge(all=TRUE, di, data.frame(YEAR=seq(min(di$YEAR), max(di$YEAR), by=1 Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Aug 1, 2014 at 8:22 PM, Florian Denzinger wrote: > Thank you everyone for your

Re: [R] Multiple plots and postscripts using split function

2014-08-02 Thread Jim Lemon
On Sat, 2 Aug 2014 05:22:26 AM Florian Denzinger wrote: > Thank you everyone for your help so far. > > I am still working on the problem to get a merged new dataframe which fills > in new rows with NA values for each year that is missing for plotting with > gaps ( in the example the item BARTLEY

Re: [R] Multiple plots and postscripts using split function

2014-08-01 Thread Florian Denzinger
Thank you everyone for your help so far. I am still working on the problem to get a merged new dataframe which fills in new rows with NA values for each year that is missing for plotting with gaps ( in the example the item BARTLEY: years 1984 to 1987 should be filled with a row containing NA v

Re: [R] Multiple plots and postscripts using split function

2014-08-01 Thread PIKAL Petr
Hi Maybe others will disagree but I find for cycle for this type of task better than sapply. for(i in 1:length(ind)) { if (there are more than 3 date items*) { postscript(ind[i]) do all plotting dev.off() }} If you want to plot with gaps you need to add all relevant YEARs for x axis with mis

Re: [R] Multiple plots and postscripts using split function

2014-07-31 Thread William Dunlap
Even better is to replace for(i in 1:length(something)) {} with for(i in seq_along(something)) {} The former gives you 2 iterations, the 2nd probably causing an error, when length(something) is 0. The latter always gives one iteration per element of 'something'. Bill Dunlap TIBCO Softwar

Re: [R] Multiple plots and postscripts using split function

2014-07-31 Thread Jeff Newmiller
The range vector is evaluated at the start of the loop, so it is only evaluated once. ind.length would be an unnecessary extra variable. --- Jeff NewmillerThe . . Go Live... DCN:

Re: [R] Multiple plots and postscripts using split function

2014-07-31 Thread Don McKenzie
While you’re at it, assign length(ind) to a variable before starting the loop. Otherwise length() is called at each iteration. e.g., ind.length <- length(ind) for (i in 1:ind.length) { etc. On Jul 31, 2014, at 10:57 AM, David L Carlson wrote: > This is one of those times when you would do b

Re: [R] Multiple plots and postscripts using split function

2014-07-31 Thread David L Carlson
This is one of those times when you would do better to just use a loop. It will be easier to debug and to see what is going on. Replace the sapply() call with for (i in 1:length(ind)) { postscript(names(ind[i])) par(mar=c(6,8,6,5), cex=0.8) plot(ind[[i]][,c('YEAR','VA

Re: [R] multiple plots on same sheet in R

2014-04-16 Thread Federico Lasa
see: ?par Does running par(mfrow=c(4,3)) do the job? On Wed, Apr 16, 2014 at 7:33 AM, eliza botto wrote: > Dear useRs, > I drew 12 separate raster maps. I want to combine them in such a way the they > appear on the same sheet in R, which will later on be saved. Each row should > contain t

Re: [R] multiple plots on same sheet in R

2014-04-16 Thread Pascal Oettli
Hi, Did you have a look at the "rasterVis" package? Regards, Pascal On Wed, Apr 16, 2014 at 9:33 PM, eliza botto wrote: > Dear useRs, > I drew 12 separate raster maps. I want to combine them in such a way the they > appear on the same sheet in R, which will later on be saved. Each row should

Re: [R] multiple plots

2014-03-08 Thread arun
Hi, Check ?matplot()  matplot(c,cbind(a,b,d),type="l",ylab="Dependent Var") #BTW, there is a typo in 'b'. (0,748). A.K. Hi, I have some values that I need to represente in the same plot. For exemple, if I have, c<-c(200,205,210,215,220,225,230,235) a<-c(0.032,0.44,0.86,0.65,0.53,0.213,0.4

Re: [R] multiple plots

2014-03-08 Thread Pete Brecknock
slavia wrote > Hi, > > I have some values that I need to represente in the same plot. > For exemple, if I have, > > c<-c(200,205,210,215,220,225,230,235) > a<-c(0.032,0.44,0.86,0.65,0.53,0.213,0.46,0.231) > b<-c(0.325,0.657,0.784,0.236,0.798,0.287,0,748,0.785) > d<-c(0.786,0.217,0.538,0.513,0.87

Re: [R] multiple plots and looping assistance requested (single plot)

2013-03-29 Thread Irucka Embry
FluxComparisonDataSet partial.pdf") par(mfrow=c(1,1)) lapply(names(temp2New),function(i) lapply(temp2New[[i]],function(x) {plot(x[,1],x[,2],main="Seasonal Flux Sum",sub=paste(i,colnames(x)[2],sep=" "),xlab="Calendar Year Timesteps",ylab="Total Flux (kg/sea

Re: [R] multiple plots and looping assistance requested (single plot)

2013-03-29 Thread arun
te.cases(x1)] }) # temp1<-lapply(temp1,function(x) x[is.data.frame(x)]) #3 columns subset temp3<-temp1[lapply(temp1,length)==3] temp3New<-temp3[sapply(temp3,is.data.frame)] pdf("Irucka.pdf") lapply(names(temp3New),function(i) {x<-temp3New[[i]]; matplot(x[,1],x[,-1],type="

Re: [R] multiple plots and looping assistance requested (revised codes)

2013-03-08 Thread arun
;) par(mfrow=c(1,1)) lapply(names(temp2New),function(i) lapply(temp2New[[i]],function(x) {plot(x[,1],x[,2],main="Seasonal Flux Sum",sub=paste(i,colnames(x)[2],sep="_"),xlab="Calendar Year Timesteps",ylab="Total Flux (kg/season)");lines(x[,1],x[,2])})) dev.off(

Re: [R] multiple plots and looping assistance requested (revised codes)

2013-03-07 Thread Irucka Embry
,i]); colnames(x1)<- c("CYEAR_DECIMAL",i);x1})) Error in temp3[, 1] : incorrect number of dimensions > temp2<-temp1[lapply(temp1,ncol)==2] > temp2New<-lapply(temp2,function(x) lapply(names(x)[-1], function(i){x1<-cbind(temp2[,1],temp2[,i]); colnames(x1)<- c("CYEAR_

Re: [R] multiple plots and looping assistance requested (revised codes)

2013-03-07 Thread arun
ux Sum",sub=paste(i,colnames(x)[2],sep="_"),xlab="Calendar Year Timesteps",ylab="Total Flux (kg/season)");lines(x[,1],x[,2])})) dev.off() A.K. ____________ From: Irucka Embry To: smartpink...@yahoo.com Cc: r-help@r-project.org Se

Re: [R] multiple plots and looping assistance requested (revised codes)

2013-03-06 Thread Irucka Embry
;Fluxmaster versus >EGRET/WRTDS \n Seasonal FLux Sum",sub=paste(i,colnames(x)[2],sep="_"),xlab="Calendar Year >Timesteps",ylab="Total Flux (kg/season)");lines(x[,1],x[,2])})) >dev.off() >A.K. > > > > > > >__

Re: [R] multiple plots and looping assistance requested (revised codes)

2013-03-06 Thread arun
dev.off() A.K. From: Irucka Embry To: smartpink...@yahoo.com Cc: r-help@r-project.org Sent: Wednesday, March 6, 2013 11:49 PM Subject: Re: [R] multiple plots and looping assistance requested (revised codes) Hi Arun, thank you for your assistance. I ha

Re: [R] multiple plots and looping assistance requested (revised codes)

2013-03-06 Thread arun
yahoo.com Sent: Wednesday, March 6, 2013 5:24 PM Subject: Re: [R] multiple plots and looping assistance requested (revised codes) Hi Arun, thanks for the note. Thank you especially for noting the use of the ";" and "{}." I have updated my own code and the possible reproducib

Re: [R] multiple plots and looping assistance requested (revised codes)

2013-03-06 Thread arun
lines(temper[[i]][1]); lines(temper[[i]][2])}) dev.off() which may not be the one you wanted. A.K. From: Irucka Embry To: smartpink...@yahoo.com Sent: Wednesday, March 6, 2013 9:32 PM Subject: Re: [R] multiple plots and looping assistance requested (revised code

Re: [R] multiple plots and looping assistance requested

2013-03-04 Thread Irucka Embry
, 21SC60WQ.SV-325, 21SC60WQ.SV-326, 21SC60WQ.SV-328, 21SC60WQ.SV-346, 21SC60WQ.SV-354, 21SCSANT.SC-001, 21SCSANT.SC-002) <-Original Message-> >From: arun [smartpink...@yahoo.com] >Sent: 3/4/2013 9:43:24 PM >To: iruc...@mail2world.com >Cc: r-help@r-project.org >Subject: Re: [

Re: [R] multiple plots and looping assistance requested

2013-03-04 Thread arun
Hi, May be you can try: res1<- gsub("\\_.*\\_.*\\_.*","",x)  res2<-sub("(\\w)(\\w)(\\w)(\\w)(\\w)(\\w)(\\w)(\\w)(\\w)(\\w)(\\w)$", "", x,perl=TRUE)  identical(res1,res2) #[1] TRUE A.K. - Original Message - From: Irucka Embry To: r-help@r-project.org Cc: Sent: Monday, March 4, 2013 9:

Re: [R] Multiple plots in one subplot

2011-12-16 Thread Greg Snow
Look at the layout function, it may do what you want. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of annek >

Re: [R] Multiple plots in one subplot

2011-12-16 Thread Rolf Turner
On 16/12/11 19:36, annek wrote: Hi, I making a figure with six sub-plots using par(mfcol=c(2,3)). In the last sub-plot I want to have two graphs instead of one. I have tried using par(fig=x,y,z,v) but this par seems to overwrite the first par. Is there a simple solution? If I understand you corre

Re: [R] multiple plots in single frame: 2 upper, 1 lower

2011-07-21 Thread DrCJones
Layout did it! Thanks guys :) -- View this message in context: http://r.789695.n4.nabble.com/multiple-plots-in-single-frame-2-upper-1-lower-tp3679574p3683144.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] multiple plots in single frame: 2 upper, 1 lower

2011-07-21 Thread Gavin Simpson
On Wed, 2011-07-20 at 23:38 +1200, Rolf Turner wrote: > On 20/07/11 11:07, DrCJones wrote: > > Hi, > > > > par(mfrow = c(2,2)) > > > > will create a 2x2 window that I can use to plot 4 diferent figures in: > > [plot1 plot2] > > [plot3 plot4] > > > > But how can do 3 so that the bottom spans the wid

Re: [R] multiple plots in single frame: 2 upper, 1 lower

2011-07-20 Thread Rolf Turner
On 20/07/11 11:07, DrCJones wrote: Hi, par(mfrow = c(2,2)) will create a 2x2 window that I can use to plot 4 diferent figures in: [plot1 plot2] [plot3 plot4] But how can do 3 so that the bottom spans the width of the upper two: [plot1 plot1] [p l o t 3] Is this possible in R? In R ***a

Re: [R] multiple plots in single frame: 2 upper, 1 lower

2011-07-20 Thread Dieter Menne
DrCJones wrote: > > But how can do 3 so that the bottom spans the width of the upper two: > > [plot1 plot1] > [p l o t 3] > > ?layout for standard graphics (plot..), but that's what you are referring to. For trellis, you must use other methods. Dieter -- View this message in context

Re: [R] multiple plots in single frame: 2 upper, 1 lower

2011-07-20 Thread Joshua Wiley
Hi, Try looking at ?layout. Here is a simple example: layout(matrix(c(1, 2, 3, 3), 2, byrow = TRUE)) plot(1:10); plot(11:20); plot(21:40) Cheers, Josh On Tue, Jul 19, 2011 at 4:07 PM, DrCJones wrote: > Hi, > > par(mfrow = c(2,2)) > > will create a 2x2 window that I can use to plot 4 diferent

Re: [R] Multiple plots on one device using stl

2011-05-17 Thread Ben Madin
G'day Bill, On 18/05/2011, at 10:36 AM, wrote: > If you > > ?plot.stl > > you will see that that the second argument, set.pars, is a list of argument > settings for par(), including a (variable) default setting for mfrow. I.e. > plot.stl overrides your external setting (which will also ove

Re: [R] Multiple plots on one device using stl

2011-05-17 Thread Bill.Venables
If you ?plot.stl you will see that that the second argument, set.pars, is a list of argument settings for par(), including a (variable) default setting for mfrow. I.e. plot.stl overrides your external setting (which will also override any layout() setting). It looks like to override it ba

Re: [R] Multiple plots with one legend

2011-03-27 Thread jim holtman
Here is how to do the legend: x <- cbind(rbind(1,2,3), 4) layout(x, width = c(5,1)) layout.show(4) plot(1:10, type = 'l') plot(1:10, type = 'l') plot(1:10, type = 'l') # reset margins for creating the legend oldMar <- par(mar = c(0,0,0,0)) plot.new() legend('center' , legend = 1:10 , lwd

Re: [R] Multiple plots with one legend

2011-03-26 Thread mavkoup
Yes that's what I had managed to generate too. I can produce my 3 plots. Each plot has 10 colored lines say. I want to place the legend in the 4th spot listing the name of the 10 colored lines, and their color. -- View this message in context: http://r.789695.n4.nabble.com/Multiple-plots-with-one

Re: [R] Multiple plots with one legend

2011-03-26 Thread jim holtman
You can use 'layout' to create 4 plot areas: the 3 plot you currently have, and one for the legend. Try this to see what happens: > x <- cbind(rbind(1,2,3), 4) > layout(x, width = c(5,1)) > layout.show(4) On Sat, Mar 26, 2011 at 7:06 PM, mavkoup wrote: > Hi, > > I've created 3 plots one under

Re: [R] Multiple plots with one legend

2011-03-26 Thread David Winsemius
On Mar 26, 2011, at 8:27 PM, mavkoup wrote: Ok I think I can figure that out. Which leads me to a further question. My 3 plots contain 10 time series, each with a different name and color. Can I create the legend such that it has a line of the correct color follow by the name of the serie

Re: [R] Multiple plots with one legend

2011-03-26 Thread mavkoup
Ok I think I can figure that out. Which leads me to a further question. My 3 plots contain 10 time series, each with a different name and color. Can I create the legend such that it has a line of the correct color follow by the name of the series? I.e. line(with color1) NAME 1 line(with color2) NA

Re: [R] Multiple plots with one legend

2011-03-26 Thread David Winsemius
On Mar 26, 2011, at 7:06 PM, mavkoup wrote: Hi, I've created 3 plots one under the other, and want to include a legend on the right that spans the height of all 3 plots. ?mtext # with the `las` parameter for rotation Or you can use: text(x,y, "some text", srt=-90,xpd=NA ) -- Davi

Re: [R] multiple plots with QQplot of PerformanceAnalytics

2011-03-25 Thread Joshua Ulrich
Please don't cross-post. -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Fri, Mar 25, 2011 at 8:33 AM, William Mok wrote: > Hi All, > > I am trying to plot 4 graphs on to 1 page using layout(...), or par(mfcol = > c(...)); with the function QQplot from the package PerformanceAnalytics

Re: [R] multiple plots using a loop

2011-02-21 Thread Iain Gallagher
Hi Darcy This works for me: Factor <- rep(factor(letters[1:4]), each = 10) Size <- runif(40) * 100 par(mfrow = c(2, 2)) for (i in unique(Factor)) { hist(Size[Factor == i], main = i, xlab = paste("n =",length(Size[Factor == i])), ylab = "") } I think that using for (i in Factor) cycles through

Re: [R] multiple plots using a loop

2011-02-21 Thread Gabor Grothendieck
On Mon, Feb 21, 2011 at 4:25 AM, Darcy Webber wrote: > Dear R users, > > I am trying to write myself a loop in order to produce a set of 20 > length frequency plots each pertaining to a factor level. I would like > each of these plots to be available on the same figure, so I have used > par(mfrow

Re: [R] multiple plots using a loop

2011-02-21 Thread ONKELINX, Thierry
> Verzonden: maandag 21 februari 2011 12:45 > Aan: Darcy Webber > CC: r-help@r-project.org > Onderwerp: Re: [R] multiple plots using a loop > > Hi: > > Here's one way with the plyr package and function d_ply(); > the hist() function itself is not very elegant, bu

Re: [R] multiple plots using a loop

2011-02-21 Thread Dennis Murphy
Hi: Here's one way with the plyr package and function d_ply(); the hist() function itself is not very elegant, but it 'works' for this example. Factor <- rep(factor(letters[1:4]), each = 10) Size <- runif(40) * 100 library(plyr) par(mfrow = c(2, 2)) d <- data.frame(Factor, Size) # Function to pro

Re: [R] Multiple plots in one window

2010-11-17 Thread Dennis Murphy
Hi: Try this: pf <- function(p) { plot(c(p:(p+10)),c(1:11)) plot(c(p:(p+10)),c(2:12)) plot(c(p:(p+10)),c(3:13)) } par(mfrow = c(3, 3)) for(i in 1:3) pf(i) par(mfrow = c(1, 1)) HTH, Dennis On Wed, Nov 17, 2010 at 8:56 AM, Soyeon Kim wrote: > Dear All, > > I made a function which gives 3

Re: [R] Multiple plots in a single page and stripplot()

2010-06-17 Thread Deepayan Sarkar
On Thu, Jun 17, 2010 at 12:57 PM, Lars Karlsson wrote: > I want to make a 2x2 plot on a single page, using stripplot() and boxplot(). > I tried the following two alternatives with mfrow() and layout(), but none > of them worked. > > library(lattice) > par(mfrow=c(2,2)) > boxplot(X1 ~ Y, data=tst1,

Re: [R] Multiple plots in a single page and stripplot()

2010-06-17 Thread Joris Meys
Hi Lars Stripplot is defunct in R 2.10 and following releases, so I wonder a bit why you would still insist on using it. Your code will not be compatible with newer R versions, so I suggest you use stripchart instead (and maybe update your R as well). Cheers Joris On Thu, Jun 17, 2010 at 9:27

Re: [R] multiple plots without for loops

2010-06-16 Thread Petr PIKAL
27;s the correct name. ls(all=TRUE) will > > confirm it) first. > > > > HTH ... > > > > Peter Alspach > > > >> -Original Message- > >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > >> project.org] On Behalf Of sh

Re: [R] multiple plots without for loops

2010-06-15 Thread sheck
y, 16 June 2010 3:27 p.m. To: Phil Spector Cc: r-help@r-project.org Subject: Re: [R] multiple plots without for loops Thanks for the reply, Phil. My computer gets hung up on the par(ask=TRUE) call. I just tried readline("Hit to proceed.") and, it works well going forward. However, I

Re: [R] multiple plots without for loops

2010-06-15 Thread Peter Alspach
s(all=TRUE) will confirm it) first. HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of sh...@ucar.edu > Sent: Wednesday, 16 June 2010 3:27 p.m. > To: Phil Spector > Cc: r-help@r-p

Re: [R] multiple plots without for loops

2010-06-15 Thread sheck
Thanks for the reply, Phil. My computer gets hung up on the par(ask=TRUE) call. I just tried readline("Hit to proceed.") and, it works well going forward. However, I cannot go backwards. Any thoughts? thanks again- sherri Quoting Phil Spector : Sherri - Perhaps calling par(ask=TRU

Re: [R] multiple plots without for loops

2010-06-15 Thread Phil Spector
Sherri - Perhaps calling par(ask=TRUE) before plotting would be useful. (You'll be prompted to hit Return to see the next plot in the series.) - Phil Spector Statistical Computing Facility

Re: [R] Multiple plots; single x(y) labels

2010-05-14 Thread Shi, Tao
ha, I was focusing on the wrong thing! Sorry, Gurmeet. Good job! > >From: Xin Ge >To: "Shi, Tao" >Cc: Gurmeet ; Jim Lemon ; >r-help@r-project.org >Sent: Fri, May 14, 2010 10:51:26 AM >Subject: Re: [R] Multiple plots; single x(y) labels > > >Th

Re: [R] Multiple plots; single x(y) labels

2010-05-14 Thread Xin Ge
xes, rather than just one > single xlab or ylab. > > Jim's solution is much more fancier than mine :-) > > ...Tao > > > > > - Original Message > > From: Gurmeet > > To: Jim Lemon > > Cc: r-help@r-project.org > > Sent: Fri, Ma

Re: [R] Multiple plots; single x(y) labels

2010-05-14 Thread Shi, Tao
2010 10:00:03 AM > Subject: Re: [R] Multiple plots; single x(y) labels > > Hi Xin, Or, just try adding "oma" and "mtext" > commands: ?par ?mtext # > Code par(mfcol=c(2,2)) par(oma=c(2,2,0,0)) plot(x <- sort(rnorm(7)), > type = "s", main =

Re: [R] Multiple plots; single x(y) labels

2010-05-14 Thread Gurmeet
Hi Xin, Or, just try adding "oma" and "mtext" commands: ?par ?mtext # Code par(mfcol=c(2,2)) par(oma=c(2,2,0,0)) plot(x <- sort(rnorm(7)), type = "s", main = "", ylab="", xlab="") plot(x <- sort(rnorm(27)), type = "s", main = "", ylab="", xlab="") plot(x <- sort(rnorm(47)), type = "s", main = ""

Re: [R] Multiple plots; single x(y) labels

2010-05-14 Thread Jim Lemon
On 05/14/2010 02:04 AM, Xin Ge wrote: Hi All, Can anyone please help me with getting a single x and y-axis label while plotting muliple plots. Here is the code: par(mfcol=c(2,2)) plot(x<- sort(rnorm(7)), type = "s", main = "", ylab="", xlab="") plot(x<- sort(rnorm(27)), type = "s", main = "", y

Re: [R] Multiple plots; single x(y) labels

2010-05-13 Thread Henrique Dallazuanna
Try this: x1 <- rnorm(7) x2 <- rnorm(27) x3 <- rnorm(47) x4 <- rnorm(67) xyplot(value ~ i | id, do.call(rbind, lapply(ls(patt = "x"), function(x)data.frame(id = x, value = get(x), i = seq_along(get(x), type='l') On Thu, May 13, 2010 at 1:04 PM, Xin Ge wrote

Re: [R] Multiple plots; single x(y) labels

2010-05-13 Thread Shi, Tao
e same xlim and ylim. Like David said, you're re-inventing the wheels . ...Tao - Original Message > From: Xin Ge > To: David Winsemius > Cc: r-help@r-project.org > Sent: Thu, May 13, 2010 10:24:56 AM > Subject: Re: [R] Multiple plots; single x(y) labels > >

Re: [R] Multiple plots; single x(y) labels

2010-05-13 Thread David Winsemius
On May 13, 2010, at 1:24 PM, Xin Ge wrote: > Hi David (and Others), > > I think I messed it up. Lets start afresh, I do not want to use > lattice for this. I'm using multiple "plot" commands and then > eventually would like to get a *combine* x-label and y-label for > this plot. > > Like fo

Re: [R] Multiple plots; single x(y) labels

2010-05-13 Thread schuster
Hello Xin, If you need to recreate plots from different systems you need full control over the graphics output. This is not always easy with traditional graphics, better have a look at the plotting functions from lattice (based on grid graphics system in R) or maybe ggplot2. http://www.googl

Re: [R] Multiple plots; single x(y) labels

2010-05-13 Thread Xin Ge
Hi David (and Others), I think I messed it up. Lets start afresh, I do not want to use lattice for this. I'm using multiple "plot" commands and then eventually would like to get a *combine* x-label and y-label for this plot. Like for example, the following plot has a combine x-label ("Height") an

Re: [R] Multiple plots; single x(y) labels

2010-05-13 Thread David Winsemius
On May 13, 2010, at 12:59 PM, Xin Ge wrote: Hi David, Thanks for your reply. By single x and y-labels I meant something like this: http://zoonek.free.fr/blosxom//R/2006-08-10_lattice_xyplot_quakes.png which lattice gives by default. The code you sent doesn't seem to solve the problem, I

Re: [R] Multiple plots; single x(y) labels

2010-05-13 Thread Xin Ge
Hi David, Thanks for your reply. By single x and y-labels I meant something like this: http://zoonek.free.fr/blosxom//R/2006-08-10_lattice_xyplot_quakes.png which lattice gives by default. The code you sent doesn't seem to solve the problem, I'm sorry if I havent' explained it clearly before. A

Re: [R] Multiple plots; single x(y) labels

2010-05-13 Thread David Winsemius
On May 13, 2010, at 12:35 PM, David Winsemius wrote: ?plot # ylim and you need to have the data in a form (before plotting) where you can determine the shared max and min for the y limits On May 13, 2010, at 12:04 PM, Xin Ge wrote: Hi All, Can anyone please help me with getting a sing

Re: [R] Multiple plots; single x(y) labels

2010-05-13 Thread David Winsemius
?plot # ylim and you need to have the data in a form (before plotting) where you can determine the shared max and min for the y limits On May 13, 2010, at 12:04 PM, Xin Ge wrote: Hi All, Can anyone please help me with getting a single x and y-axis label while plotting muliple plots. H

Re: [R] multiple plots problem

2010-04-20 Thread Kay Cichini
hi thomas, thanks a lot- of course that's it. i knew why the middle plot is stretcht, but didn't figure out that settting par(oma) is the key.. greetings, kay -- View this message in context: http://n4.nabble.com/multiple-plots-problem-tp2017326p2017551.html Sent from the R help mailing list

Re: [R] multiple plots problem

2010-04-20 Thread Thomas Stewart
The stretching of plot two occurs because you are allotting more space for plot two. You set Plot 1: mar=c(0,4,4,2) Plot 2: mar=c(0,4,0,2) Plot 3: mar=c(4,4,0,2) In plot one your are dedicating 4 lines to the top margin, in plot three you are dedicating 4 lines to the bottom margin. In plot two,

Re: [R] multiple plots using summary in rms package

2009-12-07 Thread Frank E Harrell Jr
Mike, You are not using rms functions in your example; you are using Hmisc's summary.formula function and its plot method. For method='reverse', multiple plots may be produced by the plot method so par(mfrow=c( )) is not well defined. There is also a problem with the dotchart2 function (cal

Re: [R] multiple plots in same graph window

2009-04-21 Thread William Dunlap
If you call par(new=TRUE) after each call to par(fig=c(xmin,xmax,ymin,ymax)) then a subsequent call to plot() will not erase the page. In S+ the par(new=TRUE) is not needed, but it does no harm. Bill Dunlap TIBCO Software Inc - Spotfire Division wdunlap tibco.com

Re: [R] multiple plots in same graph window

2009-04-21 Thread David Winsemius
On Apr 21, 2009, at 12:58 PM, BARRES-DE-ALMEIDA U. wrote: Hi, I'm trying to make multiple plots in a same graph window in R. The multiple graphs are showing up in the right positions on the window, but I'm having the problem that the graphic window is being refreshed every time a new plot

Re: [R] multiple plots in R

2008-11-23 Thread Felipe Carrillo
Here's one way with ggplot2 library(ggplot2) p <- qplot(mpg, wt, data=mtcars) vplayout <- function(x, y) viewport(layout.pos.row=x, layout.pos.col=y) grid.newpage() pushViewport(viewport(layout=grid.layout(3,3))) print(p, vp=vplayout(1,1)) print(p, vp=vplayout(1,2)) print(p, vp=vplayout(1,3)) prin

Re: [R] multiple plots in R

2008-11-23 Thread Sebastian P. Luque
On Sun, 23 Nov 2008 18:19:19 -0800, Suyan Tian <[EMAIL PROTECTED]> wrote: > Hi, I just try to draw multiple plots in one page using R, I used par > command. For example I have 7 plots, but instead of arranging them in > the default way > plot1 plot2 plot3 plot4 plot5 plot6 plot7 > I want them in

Re: [R] multiple plots in R

2008-11-23 Thread Sarah Goslee
You can use frame() to skip a place. On Sun, Nov 23, 2008 at 9:19 PM, Suyan Tian <[EMAIL PROTECTED]> wrote: > Hi, I just try to draw multiple plots in one page using R, I used par > command. For example I have 7 plots, but instead of arranging them in the > default way > > plot1plot2 plot3 >

Re: [R] Multiple plots on multiple devices

2008-11-03 Thread Felix Andrews
Hi Oliver, These are my suggestions... Option 1: use the playwith package (a GTK+ interface); Option 2: use the latticist package (a gWidgets interface, will be released in the next day or two); Option 3: use this code: plotOnePage <- function(x, page, ...) { stopifnot(inherits(x, "trelli

Re: [R] Multiple plots on multiple devices

2008-11-03 Thread Prof Brian Ripley
On Mon, 3 Nov 2008, Oliver Kimberlin wrote: Hi List, This is possibly a newbie error. I have however searched long and hard and haven't found a solution. I am attempting to plot multiple lattice graphs in R, plotting 4 per page and moving on to a new device to plot the next 4 and so on. (I wan

Re: [R] multiple plots - editing ggplot2 plot

2008-09-30 Thread Pedro Barros
Hi Hadley, Thanks for the quick reply. Well, if I could do it directly in ggplot, even better. My data is below (from "dump"). I calculate the bar heights previously, now I just want to plot them, with fixed fill colours (to make sure they match other plots I use). Thanks again, Pedro `x1` <- st

Re: [R] multiple plots - editing ggplot2 plot

2008-09-30 Thread hadley wickham
On Sat, Sep 27, 2008 at 10:20 AM, Pedro Barros <[EMAIL PROTECTED]> wrote: > > Hi All, > > I am trying to build a composite plot, with multiple categories, using > ggplot2. > > In principle, it could be done using facetting, but I do not seem to be able > to get past the defaults, so I try building

Re: [R] Multiple plots per window

2008-09-21 Thread Gabor Grothendieck
Here are two ways: one using classic graphics and one much shorter way using lattice. ggplot2 would be a another short way (not shown). Lines <- "1995 1996 1997 1998 153 133 145 111 189 177 200 170 221 241 187 243 215 228 201 178 302 283 292 248 223 255 220 202 20

Re: [R] Multiple plots per window

2008-09-21 Thread p
sorry, as Mark Leeds pointed out to me, the row/column numbers where mixed up in my example... happens when you cut & paste like mad from your history... it should read as follows: sales2.1 <- c(153,189,221,215,302,223,201,173,121,106,86,87,108, 133,177,241,228,283,255,238,164,128,108,87,74,95, 1

Re: [R] multiple plots over multiple pages

2008-05-13 Thread jim holtman
Just keep plotting them. You will get additional pages after every four plots. Now I know this is true when using PDF as the output device. On Tue, May 13, 2008 at 5:56 PM, Dirkheld <[EMAIL PROTECTED]> wrote: > > Hi, > > I would like to iterate over a dataframe and plot several graphs over > se

Re: [R] Multiple plots question

2008-03-21 Thread Mark Wardle
1. Work out what you want on the x and y scales from your data. 2. In your first call (to plot) set the xlim and ylim parameters to the required range. Good luck, Mark On 20/03/2008, Andre Nathan <[EMAIL PROTECTED]> wrote: > Hello > > (Sorry if this appears twice, had some mail problems...) >

Re: [R] Multiple plots question

2008-03-19 Thread jim holtman
You should go through and collect the 'range' of the data that you want to plot and then use "ylim" in the "plot" to set the limits for the range. On Wed, Mar 19, 2008 at 6:20 PM, Andre Nathan <[EMAIL PROTECTED]> wrote: > Hello > > I have a number of different data sets, each loaded as a matrix. I

Re: [R] multiple plots with a title using postscript()

2008-03-04 Thread Peter Dalgaard
array chip wrote: > Thanks, yes, it worked. I got another problem. I > generated these plots into a postscript file, now the > title was truncated (only show lower half). I tried > changing region argument in the postscript(), but not > working. any suggestions? > I guess you need to increase th

Re: [R] multiple plots with a title

2008-03-04 Thread Peter Alspach
John ?mtext e.g. mtext('General title', outer=T, line=-1) HTH Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of array chip > Sent: Wednesday, 5 March 2008 10:48 a.m. > To: [EMAIL PROTECTED] > Subject: [R] multiple plots with a tit

Re: [R] multiple plots per page using hist and pdf

2008-02-27 Thread John Kane
I think you need to reset the par(mfrow=c(2,2)) before plotting the second set of graphs. --- Ben Tupper <[EMAIL PROTECTED]> wrote: > Hello, > > I am puzzled by the behavior of hist() when > generating multiple plots > per page on the pdf device. In the following example > two pdf files >

Re: [R] multiple plots per page using hist and pdf

2008-02-27 Thread Ben Tupper
On Feb 27, 2008, at 11:45 AM, Gavin Simpson wrote: > On Wed, 2008-02-27 at 11:31 -0500, Ben Tupper wrote: >> Hello, >> >> I am puzzled by the behavior of hist() when generating multiple plots >> per page on the pdf device. In the following example two pdf files >> are generated. The first results

Re: [R] multiple plots per page using hist and pdf

2008-02-27 Thread Gavin Simpson
On Wed, 2008-02-27 at 11:31 -0500, Ben Tupper wrote: > Hello, > > I am puzzled by the behavior of hist() when generating multiple plots > per page on the pdf device. In the following example two pdf files > are generated. The first results in 4 plots on one pdf page as > expected. However,

Re: [R] Multiple plots with single box

2007-12-20 Thread Greg Snow
One possibility is to use the cnvrt.coords function from the TeachingDemos package. It shows an example of putting a rectangle across multiple plots. You would need to create the 1st (top) plot, find the coordinate of the top and convert that to device coordinates, then create the rest of your p