Greetings all: I have to create a graph that has very specific dimensions for publication purposes. The graph is a semilog scaled graph and the axes must range from 1 to 1,000,000 on the y axis and 0 to 100 on the x axis. The x axis should be exactly 8 inches and the y axis should be exactly 5.25 inches. I've been able to set the plot area to 8 x 5.25 using the par(pin=c(8,5.25)). The problem that I'm running into is that R seems to extend my data range by 4% to create a "bounding box" and this throws off the layout of my graph. Is there some way to change this behavior? Thanks in advance for any help. -- Richard L. Anderson, MS Security Analyst, University of North Texas UNT Computing Center <mailto:anderson at unt.edu>
Richard Anderson wrote:> Greetings all: > > I have to create a graph that has very specific dimensions for > publication purposes. The graph is a semilog scaled graph and the > axes must range from 1 to 1,000,000 on the y axis and 0 to 100 on the > x axis. The x axis should be exactly 8 inches and the y axis should > be exactly 5.25 inches. I've been able to set the plot area to 8 x > 5.25 using the par(pin=c(8,5.25)). The problem that I'm running into > is that R seems to extend my data range by 4% to create a "bounding > box" and this throws off the layout of my graph. Is there some way > to change this behavior? Thanks in advance for any help.You can use "xaxs" and "yaxs". For example plot(1:10, xaxs="i", yaxs="i") or use par() to set these permanantly. ?par will gt you documentation. -- Ross Ihaka Email: ihaka at stat.auckland.ac.nz Department of Statistics Phone: (64-9) 373-7599 x 85054 University of Auckland Fax: (64-9) 373-7018 Private Bag 92019, Auckland New Zealand
If you are using postscript files, see ?postscript to specify the width and height of the plot. See also Section 12.5.3 (Figure margins) of the manual "An Introduction to R". Hopefully, it'll help you fix your apparent margins problem. See also "xlim" and "ylim" in plot() to specify the range. And see "xlog" and "ylog" of par() to use log-scale. Jerome On April 23, 2003 02:11 pm, Richard Anderson wrote:> Greetings all: > > I have to create a graph that has very specific dimensions for > publication purposes. The graph is a semilog scaled graph and the > axes must range from 1 to 1,000,000 on the y axis and 0 to 100 on the > x axis. The x axis should be exactly 8 inches and the y axis should > be exactly 5.25 inches. I've been able to set the plot area to 8 x > 5.25 using the par(pin=c(8,5.25)). The problem that I'm running into > is that R seems to extend my data range by 4% to create a "bounding > box" and this throws off the layout of my graph. Is there some way > to change this behavior? Thanks in advance for any help.
On Wed, Apr 23, 2003 at 04:11:33PM -0500, Richard Anderson wrote:> Greetings all: > > I have to create a graph that has very specific dimensions for > publication purposes. The graph is a semilog scaled graph and the > axes must range from 1 to 1,000,000 on the y axis and 0 to 100 on the > x axis. The x axis should be exactly 8 inches and the y axis should > be exactly 5.25 inches. I've been able to set the plot area to 8 x > 5.25 using the par(pin=c(8,5.25)). The problem that I'm running into > is that R seems to extend my data range by 4% to create a "bounding > box" and this throws off the layout of my graph. Is there some way > to change this behavior? Thanks in advance for any help. >Thanks everyone. The combination of xaxs, yaxs, pin, xlim, and ylim did the trick for me. -- Richard L. Anderson, MS Security Analyst, University of North Texas UNT Computing Center <mailto:anderson at unt.edu>