[R] Background color of symbols in xyplot

2007-08-03 Thread Sébastien
Dear R-users,

I am using plot symbols given by pch=21:25 in a xyplot. The background 
color of these symbols can be defined by 'fill' in the panel argument, 
however I have a hard time to find how to define the same background 
color in the key. I tried different options like using the auto.key 
argument and modifying the par.settings, or using normal key argument 
plus 'fill', 'bg' or 'background'... nothing seems to do I want. What 
should I change in the following code to make it work ?

key=list(space=bottom,
 points = list(pch = 21:25,
  col = 32,
  bg=15),
 text=list(mylegend)),


Thank in advance

Sebastien

PS: cheng

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Background color of symbols in xyplot

2007-08-03 Thread deepayan . sarkar
On 8/2/07, Sébastien [EMAIL PROTECTED] wrote:
 Dear R-users,

 I am using plot symbols given by pch=21:25 in a xyplot. The background
 color of these symbols can be defined by 'fill' in the panel argument,
 however I have a hard time to find how to define the same background
 color in the key. I tried different options like using the auto.key
 argument and modifying the par.settings, or using normal key argument
 plus 'fill', 'bg' or 'background'... nothing seems to do I want. What
 should I change in the following code to make it work ?

 key=list(space=bottom,
  points = list(pch = 21:25,
   col = 32,
   bg=15),
  text=list(mylegend)),

For starters, upgrade to the latest version of R and lattice.

-Deepayan

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Background color of symbols in xyplot

2007-08-03 Thread Sébastien
Thank you very much for your help. I have installed the latest versions 
of R and lattice are installed, and now the 'fill' argument (instead of 
bg) gives me what I want.

[EMAIL PROTECTED] a écrit :
 On 8/2/07, Sébastien [EMAIL PROTECTED] wrote:
   
 Dear R-users,

 I am using plot symbols given by pch=21:25 in a xyplot. The background
 color of these symbols can be defined by 'fill' in the panel argument,
 however I have a hard time to find how to define the same background
 color in the key. I tried different options like using the auto.key
 argument and modifying the par.settings, or using normal key argument
 plus 'fill', 'bg' or 'background'... nothing seems to do I want. What
 should I change in the following code to make it work ?

 key=list(space=bottom,
  points = list(pch = 21:25,
   col = 32,
   bg=15),
  text=list(mylegend)),
 

 For starters, upgrade to the latest version of R and lattice.

 -Deepayan
   

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] background color

2007-04-17 Thread yannig goude
hi,
  I want to add different colors on the background of a classical plot. Each 
color is associated to an interval of the x axis.
  example: the background is red on the interval [1,10], blue on [11,20].
  I try the rect function but it isn't appropriate for the background.
  Can any one can help me please?
  best regards.
 

 
-

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] background color

2007-04-17 Thread Petr Klasterecky
What do you mean by background? Maybe this is enough:

plot(seq(-3,3,.01), dnorm(seq(-3,3,.01)), type=n, xlab=x, 
ylab=f(x), main=Normal density)
polygon(x=c(-4,0,0,-4), y=c(-1,-1,.5,.5), col=red)
polygon(x=c(4,0,0,4), y=c(-1,-1,.5,.5), col=blue)
lines(seq(-3,3,.01), dnorm(seq(-3,3,.01)), type=l, lwd=2)

Play a little bit with the polygon margins to get what you need. You can 
even generate them automatically based on your data.

Petr

yannig goude napsal(a):
 hi,
   I want to add different colors on the background of a classical plot. Each 
 color is associated to an interval of the x axis.
   example: the background is red on the interval [1,10], blue on [11,20].
   I try the rect function but it isn't appropriate for the background.
   Can any one can help me please?
   best regards.
  
 
  
 -
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 

-- 
Petr Klasterecky
Dept. of Probability and Statistics
Charles University in Prague
Czech Republic

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] background color

2007-04-17 Thread Gabor Grothendieck
On 4/17/07, yannig goude [EMAIL PROTECTED] wrote:
  I want to add different colors on the background of a classical plot. Each 
 color is associated to an interval of the x axis.
  example: the background is red on the interval [1,10], blue on [11,20].
  I try the rect function but it isn't appropriate for the background..

You can use rect together with par(usr) like this:

usr - par(usr)
plot(1:20, type = n)
rect(1, usr[3], 10, usr[4], col = red)
rect(11, usr[3], 20, usr[4], col = blue)
points(1:20)

There is also an example of this using polygon in place of rect here:

http://www.mayin.org/ajayshah/KB/R/html/g5.html

and an example of doing it with lattice graphics using xyplot.zoo
(the same idea would work with xyplot) mid way through the examples in:

library(zoo)
?xyplot.zoo

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] background color behind symbols in legend()

2007-03-05 Thread Nicolas Mazziotta
Hello,

I try to display coloured rectangles behind symbols in a legend (as a 
background):

 plot(10,10)
 legend(top, c(text,text2), pch=c(21,22), fill=c(red,green), 
pt.bg=black) 

On the resulting graph, the symbol is not centered upon the coloured 
rectangle. Is there a way to adjust their relative position, so that they are 
centered? Looking through ?legend has not helped me (but I might have missed 
the line where it is explained)...
 
[R version 2.4.0 (2006-10-03) on linux]

Thanks for any help.

Best regards,


-- 
Nicolas Mazziotta

The contents of this e-mail, including any attachments, are ...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] background color in strip.custom()

2006-12-04 Thread Sven Garbade
Hi all,
how can I change the background color in lattice strips according to a
factor level, eg:

library(lattice)
x - rnorm(100)
y - sqrt(x)
f - gl(2, 50, c(A, B))
xyplot(y ~ x | f)

I like to change the background color of the strips according to the
levels in f and tried several things like this with no success:

xyplot(y ~ x | f, strip=strip.custom(bg=c(red, green)))

Is this possible?

Thanks, Sven

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] background color in strip.custom()

2006-12-04 Thread Duncan Mackay
One way is to use the argument par.settings

get the right name

names(trellis.par.get())

or

str(trellis.par.get())

to find the list names to change

then

xyplot(y ~ x | f,
   par.settings = list(strip.background = list(col = c(your colours)) )


Regards

Duncan

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
ARMIDALE NSW 2351
Email: [EMAIL PROTECTED]
   home: [EMAIL PROTECTED]
Phone: 02 6772 9794

At 20:01 04/12/06, you wrote:
Hi all,
how can I change the background color in lattice strips according to a
factor level, eg:

library(lattice)
x - rnorm(100)
y - sqrt(x)
f - gl(2, 50, c(A, B))
xyplot(y ~ x | f)

I like to change the background color of the strips according to the
levels in f and tried several things like this with no success:

xyplot(y ~ x | f, strip=strip.custom(bg=c(red, green)))

Is this possible?

Thanks, Sven

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] background color in strip.custom()

2006-12-04 Thread Deepayan Sarkar
On 12/4/06, Sven Garbade [EMAIL PROTECTED] wrote:
 Hi all,
 how can I change the background color in lattice strips according to a
 factor level, eg:

 library(lattice)
 x - rnorm(100)
 y - sqrt(x)
 f - gl(2, 50, c(A, B))
 xyplot(y ~ x | f)

 I like to change the background color of the strips according to the
 levels in f and tried several things like this with no success:

 xyplot(y ~ x | f, strip=strip.custom(bg=c(red, green)))

 Is this possible?

Yes, you just have to write a custom strip function (slightly beyond
what strip.custom is capable of):

xyplot(y ~ x | f,
   strip = function(..., which.panel, bg) {
   bg.col = trellis.par.get(strip.background)$col;
   ## or bg.col = c(red, green) if you prefer
   strip.default(..., which.panel = which.panel,
bg = rep(bg.col, length = which.panel)[which.panel])
   })

This will only work when you have one conditioning variable (otherwise
'which.panel' won't be a scalar), but you haven't told us what you
want to happen otherwise.

-Deepayan

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] background color in strip.custom()

2006-12-04 Thread Deepayan Sarkar
On 12/4/06, Duncan Mackay [EMAIL PROTECTED] wrote:
 One way is to use the argument par.settings

 get the right name

 names(trellis.par.get())

 or

 str(trellis.par.get())

 to find the list names to change

 then

 xyplot(y ~ x | f,
par.settings = list(strip.background = list(col = c(your colours)) 
 )

That's answering a slightly different question, I think.

-Deepayan



 Regards

 Duncan

 Duncan Mackay
 Department of Agronomy and Soil Science
 University of New England
 ARMIDALE NSW 2351
 Email: [EMAIL PROTECTED]
home: [EMAIL PROTECTED]
 Phone: 02 6772 9794

 At 20:01 04/12/06, you wrote:
 Hi all,
 how can I change the background color in lattice strips according to a
 factor level, eg:
 
 library(lattice)
 x - rnorm(100)
 y - sqrt(x)
 f - gl(2, 50, c(A, B))
 xyplot(y ~ x | f)
 
 I like to change the background color of the strips according to the
 levels in f and tried several things like this with no success:
 
 xyplot(y ~ x | f, strip=strip.custom(bg=c(red, green)))
 
 Is this possible?
 
 Thanks, Sven

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] background color of xyplot

2005-10-09 Thread Marc Bernard
Dear All, 
 
I am wondering if there is a way to change the color  of  the panels of  the  
xyplot  (lattice package) from gray to white  ..  Because the  printing 
 of the xyplot's graph is not  visible with the gray color ... I've seen the 
xyplot help  but without any success
 
 
Thanks  lot in advance, 
 
 
Bernard, 
 
 


-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] background color of xyplot

2005-10-09 Thread ronggui
 see ?trellis.device

 trellis.device(color=F)
  Depth - equal.count(quakes$depth, number=8, overlap=.1)
  xyplot(lat ~ long | Depth, data = quakes)


will get what you want.


=== 2005-10-09 22:32:10 您在来信中写道:===

Dear All, 
 
I am wondering if there is a way to change the color  of  the panels of  the  
xyplot  (lattice package) from gray to white  ..  Because the  
printing  of the xyplot's graph is not  visible with the gray color ... I've 
seen the xyplot help  but without any success
 
 
Thanks  lot in advance, 
 
 
Bernard, 
 
 

   
-


   [[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

= = = = = = = = = = = = = = = = = = = =



 

2005-10-09

--
Deparment of Sociology
Fudan University

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] background color for plotting symbols in 'matplot'

2005-01-19 Thread Uwe Ligges
joerg van den hoff wrote:
something like
matplot2(matrix(1:6,3,2),matrix(7:12,3,2),pch=21,bg=c(2,3),type='b')
Where can we find matplot2?

does not yield the expected (at least by me) result: only the points on 
the first line get (successively) background colors for the plotting 
symbols, the second line gets no background color at all for its 
plotting symbols.

I think the natural behaviour should be two curves which (for the 
example given above) symbol-background colors 2 and 3, respectively (as 
would be obtained by a suitable manual combination of 'plot' and 
'lines'). the modification of the matplot code to achieve this behaviour 
is obvious as far as I can see (adding 'bg' to the explicit arguments of 
matplot and handling similar to 'lty', 'cex' and the like inside the 
function including transfer to 'plot' and 'lines' argument list).

is the present behaviour a bug of 'matplot' or is it for some reason 
intended behaviour?
The real point is that you might want to mark by rows *or* by columns, 
so it's not that easy to specify a sensible default behaviour, at least 
one has to think about it.

If you want to implement it for all possible arguments, the well known 
problem of huge number of arguments springs to mind as well.

Since you say the modification [...] is obvious: I think R-core 
welcomes your contribution.

Uwe Ligges

regards,
joerg
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] background color for plotting symbols in 'matplot'

2005-01-19 Thread joerg van den hoff
thanks for the response.
Uwe Ligges wrote:
joerg van den hoff wrote:
something like
matplot2(matrix(1:6,3,2),matrix(7:12,3,2),pch=21,bg=c(2,3),type='b')

Where can we find matplot2?
oops. that should have been 'matplot' (not 'matplot2'), of course.

does not yield the expected (at least by me) result: only the points 
on the first line get (successively) background colors for the 
plotting symbols, the second line gets no background color at all for 
its plotting symbols.

I think the natural behaviour should be two curves which (for the 
example given above) symbol-background colors 2 and 3, respectively 
(as would be obtained by a suitable manual combination of 'plot' and 
'lines'). the modification of the matplot code to achieve this 
behaviour is obvious as far as I can see (adding 'bg' to the explicit 
arguments of matplot and handling similar to 'lty', 'cex' and the like 
inside the function including transfer to 'plot' and 'lines' argument 
list).

is the present behaviour a bug of 'matplot' or is it for some reason 
intended behaviour?

The real point is that you might want to mark by rows *or* by columns, 
so it's not that easy to specify a sensible default behaviour, at least 
one has to think about it.
I'm aware of this: any specific behaviour could be the 'best' default 
for someone. in terms of consistency, I would argue that matplot plots 
columns of x against columns of y, so these columns should be 
addressed. that is how 'lty' and 'pch' and 'cex' do it. the present 
behaviour of 'bg' ('bg' interpreted only for column 1 of x against 
column 1 of y) is not sensible.

If you want to implement it for all possible arguments, the well known 
problem of huge number of arguments springs to mind as well.
that is indeed a problem, but I think mainly when reading the help 
pages, which then are cluttered with many not often used graphic parameters.
Since you say the modification [...] is obvious: I think R-core 
welcomes your contribution.
well, I'm not a fluent R programmer. I'm not sure if the simple minded 
modification of 'matplot' would be welcome by R-core. rather, I attach 
here the modified code 'matplot2' (sic!), if someone wants to use it. a 
'diff' vs. the original versions shows easily the few modified lines.

joerg
Uwe Ligges

regards,
joerg
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html




#clone of the standard 'matplot' version augmented by using 'bg' as an
#additional explicit argument and modifications of the code leading to
#a bevaviour of 'bg' similar to 'lty', 'pch', 'cex' et cetera (columnwise
#recycling of 'bg' entries).
matplot2 - function (x, y, type = p, lty = 1:5, lwd = 1, pch = NULL, col = 
1:6, 
cex = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, bg=NULL,
..., add = FALSE, verbose = getOption(verbose)) 
{
paste.ch - function(chv) paste(\, chv, \, sep = , 
collapse =  )
str2vec - function(string) {
if (nchar(string)[1]  1) 
strsplit(string[1], NULL)[[1]]
else string
}
xlabel - if (!missing(x)) 
deparse(substitute(x))
ylabel - if (!missing(y)) 
deparse(substitute(y))
if (missing(x)) {
if (missing(y)) 
stop(Must specify at least one of `x' and `y')
else x - 1:NROW(y)
}
else if (missing(y)) {
y - x
ylabel - xlabel
x - 1:NROW(y)
xlabel - 
}
kx - ncol(x - as.matrix(x))
ky - ncol(y - as.matrix(y))
n - nrow(x)
if (n != nrow(y)) 
stop(`x' and `y' must have same number of rows)
if (kx  1  ky  1  kx != ky) 
stop(`x' and `y' must have only 1 or the same number of columns)
if (kx == 1) 
x - matrix(x, nrow = n, ncol = ky)
if (ky == 1) 
y - matrix(y, nrow = n, ncol = kx)
k - max(kx, ky)
type - str2vec(type)
if (is.null(pch)) 
pch - c(paste(c(1:9, 0)), letters)[1:k]
else if (is.character(pch)) 
pch - str2vec(pch)
if (verbose) 
cat(matplot: doing , k,  plots with , paste( col= (, 
paste.ch(col), ), sep = ), paste( pch= (, paste.ch(pch), 
), sep = ),  ...\n\n)
ii - match(log, names(xargs - list(...)), nomatch = 0)
log - if (ii != 0) 
xargs[[ii]]
xy - xy.coords(x, y, xlabel, ylabel, log = log)
xlab - if (is.null(xlab)) 
xy$xlab
else xlab
ylab - if (is.null(ylab)) 
xy$ylab
else ylab
xlim - if (is.null(xlim)) 
range(xy$x[is.finite(xy$x)])
else xlim
ylim - if (is.null(ylim)) 
range(xy$y[is.finite(xy$y)])
else ylim
if (length(type)  k) 
type - rep(type, length.out = k)
if (length(lty)  k) 
lty - rep(lty, length.out = k)
if (length(lwd)  k) 
lwd - rep(lwd, length.out = k)
if (length(pch)  k) 
pch - rep(pch, 

[R] background color for plotting symbols in 'matplot'

2005-01-18 Thread joerg van den hoff
something like
matplot2(matrix(1:6,3,2),matrix(7:12,3,2),pch=21,bg=c(2,3),type='b')
does not yield the expected (at least by me) result: only the points on 
the first line get (successively) background colors for the plotting 
symbols, the second line gets no background color at all for its 
plotting symbols.

I think the natural behaviour should be two curves which (for the 
example given above) symbol-background colors 2 and 3, respectively (as 
would be obtained by a suitable manual combination of 'plot' and 
'lines'). the modification of the matplot code to achieve this 
behaviour is obvious as far as I can see (adding 'bg' to the explicit 
arguments of matplot and handling similar to 'lty', 'cex' and the like 
inside the function including transfer to 'plot' and 'lines' argument list).

is the present behaviour a bug of 'matplot' or is it for some reason 
intended behaviour?

regards,
joerg
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Background color Windows device (newbie)

2004-10-01 Thread Jean-Louis Abitbol
Dear R Gurus

Just started on R !

Using xYplot from Hmisc (R 1.9, W2K) I get a grey/blue background that I
would like to change to white (ie no background) or may be to another
color.

Tried to do that with par(bg) but only changed the color of the trellis
heading.

What's the right command to do that ?

Kind regards, JL

PS if anyone has nice default settings for win device please let me
know. I used win.slide in Splus but apparently this does not work in R.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Background color Windows device (newbie)

2004-10-01 Thread Liaw, Andy
What you should realize is that xYplot() uses lattice, and that color theme
is the default for lattice.  trellis.device() has the `theme' argument that
you can use to change it.  The help page explains how you can change the
default:

   theme: list of components that change the settings of the device
  opened, or, a function that when called produces such a list.
  The function name can be supplied as a quoted string.

  A possible use of this argument is to change the default
  settings at session startup, for example by setting
  'options(lattice.theme = col.whitebg)'. If 'theme' is a
  function, it will not be supplied any arguments, however, it
  is guaranteed that a device will already be open when it is
  called, so one may use '.Device' inside the function to
  ascertain what device has been opened. 

Andy

 From: Jean-Louis Abitbol
 
 Dear R Gurus
 
 Just started on R !
 
 Using xYplot from Hmisc (R 1.9, W2K) I get a grey/blue 
 background that I
 would like to change to white (ie no background) or may be to another
 color.
 
 Tried to do that with par(bg) but only changed the color of 
 the trellis
 heading.
 
 What's the right command to do that ?
 
 Kind regards, JL
 
 PS if anyone has nice default settings for win device please let me
 know. I used win.slide in Splus but apparently this does not 
 work in R.
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Background color Windows device (newbie)

2004-10-01 Thread Chuck Cleland
  See the bg argument to trellis.device().  Here is an example:
library(Hmisc)
library(lattice)
trellis.device(width=7, height=5, new = TRUE, col = FALSE, bg = white)
dfr - expand.grid(month=1:12, continent=c('Europe','USA'),
 sex=c('female','male'))
set.seed(1)
dfr - upData(dfr, y=month/10 + 1*(sex=='female') +
  2*(continent=='Europe') +
  runif(48,-.15,.15),
  lower=y - runif(48,.05,.15),
  upper=y + runif(48,.05,.15))
xYplot(Cbind(y,lower,upper) ~ month,subset=sex=='male' 
   continent=='USA', data=dfr)
hope this helps,
Chuck Cleland
Jean-Louis Abitbol wrote:
Dear R Gurus
Just started on R !
Using xYplot from Hmisc (R 1.9, W2K) I get a grey/blue background that I
would like to change to white (ie no background) or may be to another
color.
Tried to do that with par(bg) but only changed the color of the trellis
heading.
What's the right command to do that ?
Kind regards, JL
PS if anyone has nice default settings for win device please let me
know. I used win.slide in Splus but apparently this does not work in R.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Background color(s) for groupedData plot

2003-06-19 Thread Renaud Lancelot
Paul, David A wrote:
I've been using par() to check the graphics parameters
associated with both plot(fitted linear model) and
plot(grouped data object).  AFAIK the only differences
are in the $cxy, $usr, $xaxp, and $yaxp parameters but
the background color for the grouped data plot is grey
while the linear model plot has a white background.
When I've tried par(bg = white) prior to using the
plot(grouped data object) command it doesn't seem to make any
difference.
How can I change the grey background to something else?

Much thanks in advance,
  David Paul
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Hi Paul,

This method calls lattice plots. An easy way to change the bg color is 
to call trellis.device explictely, e.g.

trellis.device(bg = 0)
plot(grouped data object)
Best,

Renaud

--
Dr Renaud Lancelot, vétérinaire
CIRAD, Département Elevage et Médecine Vétérinaire (CIRAD-Emvt)
Programme Productions Animales
http://www.cirad.fr/fr/pg_recherche/page.php?id=14
ISRA-LNERV  tel+221 832 49 02
BP 2057 Dakar-Hann  fax+221 821 18 79 (CIRAD)
Senegal e-mail [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Background color(s) for groupedData plot

2003-06-19 Thread Paul, David A
Thank you both for pointing out that this is a lattice
plot (ie, R's version of Trellis graphics) and therefore
needs something other than par().

I was able to use IE6.0 to search for trellis and
find the relevant commands (after using help.start(),
of course).  This brings up another question:

Is there a convenient way to decide whether or not
the generic plot( ) is going to use regular or
trellis plotting?  I looked at methods(plot) and
didn't find any groupedData plot methods listed, so
perhaps this is the clue?


-david paul

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Background color(s) for groupedData plot

2003-06-19 Thread Uwe Ligges


Paul, David A wrote:
 
 I've been using par() to check the graphics parameters
 associated with both plot(fitted linear model) and
 plot(grouped data object).  AFAIK the only differences
 are in the $cxy, $usr, $xaxp, and $yaxp parameters but
 the background color for the grouped data plot is grey
 while the linear model plot has a white background.
 
 When I've tried par(bg = white) prior to using the
 plot(grouped data object) command it doesn't seem to make any
 difference.
 
 How can I change the grey background to something else?
 
 Much thanks in advance,
   David Paul
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help


I guess you are using package nlme.
Plots for the different GroupedData classes are produced with package
lattice.
So you cannot use par(). See the documentation for package lattice.

After you have opened a device, you might want to use
  lset(col.whitebg())

or simply look into ?trellis.device how to set black and white schemes
and so on.

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Background color(s) for groupedData plot

2003-06-19 Thread Michael A. Miller
 Paul, == Paul, David A [EMAIL PROTECTED] writes:

 Is there a convenient way to decide whether or not the
 generic plot( ) is going to use regular or trellis
 plotting?  I looked at methods(plot) and didn't find any
 groupedData plot methods listed, so perhaps this is the
 clue?

It's there, but as the GroupedData methods, not groupedData.

 require(nlme)
 methods(plot)[grep('groupedData',methods(plot),ignore.case=T)]
[1] plot.nffGroupedData plot.nfnGroupedData plot.nmGroupedData 

Mike

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Background color of plot

2003-02-04 Thread Patricia Maforte dos Santos

I'm using the parameters mfrow and mfg to display some graphics(plots)
at the same time. Although, because of the parameter mfg, the parameter
bg don´t change the background color.

What can I do to solve this?


Here is the code I'm using...

...
 i - 1
 for(j in 1:4){
 for(k in 1:2){
 limiares - tabLimiar(arrayMetricas[,i])
 op - par(mfrow=c(4,2),pty=s)
 par(mfg=c(j,k))
 
plot(limiares,main=a[i],ylab=frequencia,xlab=limiares,bg=white,col=green,col.main=seagreen,type=b)
 box(which=figure,lty=solid,col=white)
 par(op)
 i - i+1
 if(i == ncol(arrayMetricas))
break
 }
 }
...


Patricia.

--
Patrícia Maforte dos Santos
Centro de Informatica
Universidade Federal de Pernambuco
Recife/PE - Brasil
--

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help