--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
On Tue, Nov 16, 2010 at 8:47 AM, MF <mcfin...@gmail.com> wrote:
> What is the best way to set the length/width of a cartesian graph? I
> would like to set the y-axis such that each unit is 0.5 inches
If you want each unit on the y-axis to take up 0.5 inches in print, it
will also be important to consider how you are saving it. Typically
the labels, etc. are set but, for example, adjusting the graphic
window size (or its corrolary in width/height for postscript/pdf
device) will also stretch/shrink the graph (which will wreak havoc if
you are trying to have an absolute print size).
> (basically set the scale of the y-axis at 1 inch = 2 feet). ... I see
> how to control the size of viewports and output to graphic devices,
> but don't see anything about how to adjust the length of the x and y
> axis. Do I need to come at the problem from another direction by
> setting the viewport size and margins and leaving the remainder for
If "close enough" is okay, I would play around a bit to find what gets
you close, and then add a line to the graph that covers 2 feet (in
graph units). Then your readers can use the length of the line to
estimate lengths.
> the panel of the graph? Will this give me the scale that I'm looking
> for?
It does not have to be fancy, but if you could provide an example, I'd
be happy to give more specific help.
Sincerely,
Josh
>
> I've had a copy of the ggplot2:Elegant Graphics for Data Analysis for
> three days now, but haven't seen anything in there that allows for
> this level of fine-tuning.
>
> Thanks much.
>
> Matt
>
> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/
I remember trying this approach some time ago,
library(ggplot2)
p = qplot(1,1)
source("http://ggextra.googlecode.com/svn/trunk/inst/tests/fixedSize.r")
g = fixedsize(p,unit(3,"in"), unit(3,"in"))
grid.draw(g)
Maybe it can be of some use to you.
HTH,
baptiste
>
> I've had a copy of the ggplot2:Elegant Graphics for Data Analysis for
> three days now, but haven't seen anything in there that allows for
> this level of fine-tuning.
>
> Thanks much.
>
> Matt
>