[R] trouble positioning legends on barplot written to a file

Tom Arnold tarnold at smpllc.com
Wed Nov 13 01:59:30 CET 2002


Thanks to all who replied with suggestions about using par(xpd=TRUE), using
dev.copy, and using a separate plot area for the legend. These are all good
and with the first response I got enough information to get a satisfactory
solution -- I haven't tried them all yet.

Another question in my post confused the issue. I mentioned that I'm using
pdf() and asked what happened to the png() function. Let me try to clarify:
- I want to produce a separate file for inclusion in web or print documents.
- In the past I've used the png() function, on Windows to create a file for
use on a web page
- I work alternately on Mac, Windows, Linux, and Mac OS X (A FreeBSD
derivative)
- I'm working on Mac OS 9.1 at the moment.

I grabbed some old files I'd created with subroutines in R that I used on R
1.4.1 on Windows. I opened them on my Mac and tried to run them in R 1.6.1 and
found that png() does not exist. I didn't think to go back to the Windows
platform and try it, and I guessed that for some reason png had disappeared --
much the same as GIF disappeared from some open source packages like GD a few
years ago because of the Unisys patent claim on LZW compression. Of course I
had no data for this, it was a guess. It didn't occur to me that a call to
produce "portable network graphics" would appear only on certain computing
platforms, [mild irony] and I saw no mention of it in the documentation.

So I looked around and found the pdf() call and started using that. For print
documents, it will probably work better anyway. Of course the formats were
created for different needs; that was not my question. I just was surprised
that png() seemed to have "disappeared" from my Mac version of R, when in fact
I guess it never existed in that version anyway.

Got that?
-Tom

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list