)) +
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
&
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
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,
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
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
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
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.
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
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
--
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
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
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
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
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
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
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
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:
While youre 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
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
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
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
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
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
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
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="
;)
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(
,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_
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
;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.
>
>
>
>
>
>
>__
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
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
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
, 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: [
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:
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
>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
> 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
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
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
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,
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
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
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
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
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
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
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
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
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 =
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 = ""
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
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
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
>
>
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
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
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
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
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
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
?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
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
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,
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
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
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
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
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
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
>
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
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
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
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
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
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
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
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...)
>
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
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
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
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
>
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
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,
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
99 matches
Mail list logo