Re: [R] Problem with colormodel in pdf driver

2009-01-26 Thread Luis Torgo

Greg Snow wrote:

You may want to consider a dotchart instead of a barplot.  Then you can 
distinguish between groups by using symbols, grouping, and labels rather than 
depending on colors/shades of grey.

  
Thanks Greg. The only problem is that I was trying to illustrate the use 
of barplot() ...


I guess for now I can always use the pdf() driver with the default RGB 
colormodel and then use command line tools (e.g. ImageMagick) to convert 
the resulting graphs to grayscale...


Thanks all for the help.

Luis

--
Luis Torgo
  FEP/LIAAD - INESC Porto, LA   Phone : (+351) 22 339 20 93
  University of Porto   Fax   : (+351) 22 339 20 99
  R. de Ceuta, 118, 6o  email : lto...@liaad.up.pt
  4050-190 PORTO - PORTUGAL WWW   : http://www.liaad.up.pt/~ltorgo

__
R-help@r-project.org 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] Problem with colormodel in pdf driver

2009-01-26 Thread Prof Brian Ripley

On Mon, 26 Jan 2009, Luis Torgo wrote:


Greg Snow wrote:
You may want to consider a dotchart instead of a barplot.  Then you can 
distinguish between groups by using symbols, grouping, and labels rather 
than depending on colors/shades of grey.



Thanks Greg. The only problem is that I was trying to illustrate the use of 
barplot() ...


I guess for now I can always use the pdf() driver with the default RGB 
colormodel and then use command line tools (e.g. ImageMagick) to convert the 
resulting graphs to grayscale...


You won't be able to convert PDF to PDF with ImageMagick (possible 
with a helper).



Thanks all for the help.


Or update your R, as the posting guide suggested.  It works in 
R-patched and R-devel.


--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@r-project.org 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] Problem with colormodel in pdf driver

2009-01-26 Thread Luis Torgo

Prof Brian Ripley wrote:

On Mon, 26 Jan 2009, Luis Torgo wrote:


Greg Snow wrote:
You may want to consider a dotchart instead of a barplot.  Then you 
can distinguish between groups by using symbols, grouping, and 
labels rather than depending on colors/shades of grey.



Thanks Greg. The only problem is that I was trying to illustrate the 
use of barplot() ...


I guess for now I can always use the pdf() driver with the default 
RGB colormodel and then use command line tools (e.g. ImageMagick) to 
convert the resulting graphs to grayscale...


You won't be able to convert PDF to PDF with ImageMagick (possible 
with a helper).

Well actually I can and it worked perfectly. Just did:
$ mogrify *.pdf -type Grayscale

and all my PDFs got changed from RGB to Grayscale. Maybe a problem with 
versions of ImageMagick mine is


$ mogrify -version
Version: ImageMagick 6.3.7 08/21/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC




Thanks all for the help.


Or update your R, as the posting guide suggested.  It works in 
R-patched and R-devel.

That's good news. I'll give it a try, thanks.



--
Luis Torgo
  FEP/LIAAD - INESC Porto, LA   Phone : (+351) 22 339 20 93
  University of Porto   Fax   : (+351) 22 339 20 99
  R. de Ceuta, 118, 6o  email : lto...@liaad.up.pt
  4050-190 PORTO - PORTUGAL WWW   : http://www.liaad.up.pt/~ltorgo

__
R-help@r-project.org 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] Problem with colormodel in pdf driver

2009-01-24 Thread Greg Snow
You may want to consider a dotchart instead of a barplot.  Then you can 
distinguish between groups by using symbols, grouping, and labels rather than 
depending on colors/shades of grey.

-- 
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-boun...@r-
 project.org] On Behalf Of Luis Torgo
 Sent: Friday, January 23, 2009 5:22 PM
 To: r-help@r-project.org
 Subject: [R] Problem with colormodel in pdf driver
 
 I'm trying to create figures in PDF that use the 'gray' colormodel
 instead of the default 'RGB' model, by requirements of a publisher.
 
 My problem has to do with the fact that I'm not being able to get gray
 colors with this option on the pdf() driver. Here is a small example
 for
 problem replication:
 
   R.version
_
 platform   i486-pc-linux-gnu
 arch   i486
 os linux-gnu
 system i486, linux-gnu
 status
 major  2
 minor  8.1
 year   2008
 month  12
 day22
 svn rev47281
 language   R
 version.string R version 2.8.1 (2008-12-22)
 
   pdf('exp.pdf',colormodel='gray')
   barplot(table(subset(iris,Petal.Width1)$Species))
   dev.off()
 
 Contrary to what I was expecting the bars appear in black and not gray
 as they are supposed to. This is not particularly serious for this toy
 graph but for others it creates more problems.
 
 Interesting enough this problem does not occur with the same option on
 the postscript() driver as it can be observed by running:
   postscript('exp.eps',colormodel='gray')
   barplot(table(subset(iris,Petal.Width1)$Species))
   dev.off()
 
 Any help is most appreciated.
 
 Luis Torgo
 
 --
 Luis Torgo
FEP/LIAAD - INESC Porto, LA   Phone : (+351) 22 339 20 93
University of Porto   Fax   : (+351) 22 339 20 99
R. de Ceuta, 118, 6o  email : lto...@liaad.up.pt
4050-190 PORTO - PORTUGAL WWW   : http://www.liaad.up.pt/~ltorgo
 
 __
 R-help@r-project.org 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@r-project.org 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] Problem with colormodel in pdf driver

2009-01-23 Thread Jorge Ivan Velez
Hi Luis,

Following David's suggestion, it worked for me:

pdf('exp.pdf',colormodel='grey')  # Note the change here :)
barplot(table(subset(iris,Petal.Width1)$Species))
dev.off()

Here is my session info:
 sessionInfo()
R version 2.8.1 Patched (2009-01-01 r47434)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base


HTH,

Jorge


On Fri, Jan 23, 2009 at 11:17 PM, David Winsemius dwinsem...@comcast.netwrote:

 Try changing the color to grey.

 Despite the help pages saying this:
 colormodel
 a character string describing the color model: currently allowed values are
 rgb, gray and cmyk. Defaults to rgb.

 I got the expected behavior by making the gray - grey change on my Mac
 OS 10.5.6/R2.8.1 system.

 --
 David Winsemius

 On Jan 23, 2009, at 7:21 PM, Luis Torgo wrote:

  I'm trying to create figures in PDF that use the 'gray' colormodel instead
 of the default 'RGB' model, by requirements of a publisher.

 My problem has to do with the fact that I'm not being able to get gray
 colors with this option on the pdf() driver. Here is a small example for
 problem replication:

  R.version
 _  platform   i486-pc-linux-gnu
arch   i486   os linux-gnu
system i486, linux-gnustatus
major  2  minor
8.1year   2008
 month  12 day22
 svn rev47281  language   R
version.string R version 2.8.1 (2008-12-22)

  pdf('exp.pdf',colormodel='gray')
  barplot(table(subset(iris,Petal.Width1)$Species))
  dev.off()

 Contrary to what I was expecting the bars appear in black and not gray as
 they are supposed to. This is not particularly serious for this toy graph
 but for others it creates more problems.

 Interesting enough this problem does not occur with the same option on the
 postscript() driver as it can be observed by running:
  postscript('exp.eps',colormodel='gray')
  barplot(table(subset(iris,Petal.Width1)$Species))
  dev.off()

 Any help is most appreciated.

 Luis Torgo

 --
 Luis Torgo
  FEP/LIAAD - INESC Porto, LA   Phone : (+351) 22 339 20 93
  University of Porto   Fax   : (+351) 22 339 20 99
  R. de Ceuta, 118, 6o  email : lto...@liaad.up.pt
  4050-190 PORTO - PORTUGAL WWW   : http://www.liaad.up.pt/~ltorgo

 __
 R-help@r-project.org 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@r-project.org 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.


[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Problem with colormodel in pdf driver

2009-01-23 Thread Prof Brian Ripley
'gray' is what is in the code: 'grey' uses rgb -- just look at the pdf 
produced.


The issue is that the wrong ('stroke' not 'fill') colour is set in ht 
'gray' colormodel.


On Fri, 23 Jan 2009, David Winsemius wrote:


Try changing the color to grey.

Despite the help pages saying this:
colormodel
a character string describing the color model: currently allowed values are 
rgb, gray and cmyk. Defaults to rgb.


I got the expected behavior by making the gray - grey change on my Mac 
OS 10.5.6/R2.8.1 system.


--
David Winsemius
On Jan 23, 2009, at 7:21 PM, Luis Torgo wrote:

I'm trying to create figures in PDF that use the 'gray' colormodel instead 
of the default 'RGB' model, by requirements of a publisher.


My problem has to do with the fact that I'm not being able to get gray 
colors with this option on the pdf() driver. Here is a small example for 
problem replication:



R.version
_  platform   i486-pc-linux-gnu 
arch   i486   os linux-gnu 
system i486, linux-gnustatus 
major  2  minor  8.1 
year   2008   month  12 
day22 svn rev47281 
language   R  version.string R version 2.8.1 
(2008-12-22)



pdf('exp.pdf',colormodel='gray')
barplot(table(subset(iris,Petal.Width1)$Species))
dev.off()


Contrary to what I was expecting the bars appear in black and not gray as 
they are supposed to. This is not particularly serious for this toy graph 
but for others it creates more problems.


Interesting enough this problem does not occur with the same option on the 
postscript() driver as it can be observed by running:

postscript('exp.eps',colormodel='gray')
barplot(table(subset(iris,Petal.Width1)$Species))
dev.off()


Any help is most appreciated.

Luis Torgo

--
Luis Torgo
FEP/LIAAD - INESC Porto, LA   Phone : (+351) 22 339 20 93
University of Porto   Fax   : (+351) 22 339 20 99
R. de Ceuta, 118, 6o  email : lto...@liaad.up.pt
4050-190 PORTO - PORTUGAL WWW   : http://www.liaad.up.pt/~ltorgo

__
R-help@r-project.org 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@r-project.org 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.


--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@r-project.org 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] Problem with colormodel in pdf driver

2009-01-23 Thread Luis Torgo
I'm trying to create figures in PDF that use the 'gray' colormodel 
instead of the default 'RGB' model, by requirements of a publisher.


My problem has to do with the fact that I'm not being able to get gray 
colors with this option on the pdf() driver. Here is a small example for 
problem replication:


 R.version
  _  
platform   i486-pc-linux-gnu  
arch   i486   
os linux-gnu  
system i486, linux-gnu
status
major  2  
minor  8.1
year   2008   
month  12 
day22 
svn rev47281  
language   R  
version.string R version 2.8.1 (2008-12-22)


 pdf('exp.pdf',colormodel='gray')
 barplot(table(subset(iris,Petal.Width1)$Species))
 dev.off()

Contrary to what I was expecting the bars appear in black and not gray 
as they are supposed to. This is not particularly serious for this toy 
graph but for others it creates more problems.


Interesting enough this problem does not occur with the same option on 
the postscript() driver as it can be observed by running:

 postscript('exp.eps',colormodel='gray')
 barplot(table(subset(iris,Petal.Width1)$Species))
 dev.off()

Any help is most appreciated.

Luis Torgo

--
Luis Torgo
  FEP/LIAAD - INESC Porto, LA   Phone : (+351) 22 339 20 93
  University of Porto   Fax   : (+351) 22 339 20 99
  R. de Ceuta, 118, 6o  email : lto...@liaad.up.pt
  4050-190 PORTO - PORTUGAL WWW   : http://www.liaad.up.pt/~ltorgo

__
R-help@r-project.org 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.