control left margin

32 views
Skip to first unread message

Andreas Leha

unread,
Mar 13, 2013, 9:05:51 AM3/13/13
to ggp...@googlegroups.com
Hi all,

in an ordinary ggplot, there is from left to right:
- plot.margin[4]
- axis.title.y
- axis.text.y
- axis.ticks.margin
- axis.ticks.length
- border of the plot area
- ...
(I am not sure, this is complete, though)

My question is:
How can I control the space up to the border of the plotting area?

As an example, I'd like the border of the plotting area to be 2cm from
the left border of the device -- independently from my
labels/fontsizes/etc.


I hope, the question is clear.

Many thanks in advance.

Regards,
Andreas


baptiste auguie

unread,
Mar 13, 2013, 2:43:58 PM3/13/13
to Andreas Leha, ggp...@googlegroups.com
Hi,

As far as I know, your best bet is to tweak the gtable object before drawing. I had an example of such manips to align multiple plotting areas:


HTH,

baptiste




--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Andreas Leha

unread,
Mar 14, 2013, 4:46:04 AM3/14/13
to ggp...@googlegroups.com
Hi Babtiste,


baptiste auguie
<baptist...@gmail.com> writes:
> On 14 March 2013 02:05, Andreas Leha
> <andrea...@med.uni-goettingen.de>
> wrote:
>
> [...]
>
> My question is:
> How can I control the space up to the border of the plotting area?
>
> [...]
>
> As far as I know, your best bet is to tweak the gtable object before
> drawing. I had an example of such manips to align multiple plotting
> areas:
>
> https://gist.github.com/baptiste/2877821
>
> HTH,
>
> baptiste

you're a wizard. The alignemt of multiple plotting areas is also my use
case.

Thanks a lot for your code!

(What is the license of your code? Just asking in case I would ever
wrap my code into an R package)

Regards,
Andreas

Reply all
Reply to author
Forward
0 new messages