I'm not sure to what extent this topic is related, but I figured
anybody who can solve this problem probably has the knowledge to solve
mine.
In my case, I am not generating all of the images in the same R script
and in many cases they do not appear on the same pages in the LaTeX
document I'm putting them. But I did still want to be consistent so
I've set the size of the Tikz output to be the same for all of my
plots. This is roughly OK in many cases, but I have different axis
numbers and the legend on the right is also not always the same. This
means that the actual plot region is not always quite the same width.
Also the horizontal centering is based on the entire Tikz output but
optically it would probably look better if I could center around the
plot itself. Is there any good way to produce an output that is
centered around a fixed-width plot region with the legend and axis
labels being drawn with respect to that? If I could do that, then my
LaTeX would be consistent.
Thanks,
Eric
On Feb 16, 8:10 am, Tengfei Yin <
yinteng...@gmail.com> wrote:
> Hi Xiaoyu,
>
> I have a function called align.plots() previously developed by Baptiste in
> ggExtra package, then I made some tweak to allow alignments with legend and
> faceting in ggplot2 0.9. it's still under development, but it should work
> now
>
>
https://github.com/tengfei/ggbio/blob/master/R/tracks.R#L78
>
> you don't have to install my package.
>
> just load ggplot2 and grid
> library(ggplot2)
> library(grid)
>
> ## load align.plots function
>
> ## do something like
>
> align.plots(p1, p2, p3)
>
> Please let me know if it doesn't work.
>
> cheers
>
> Tengfei
>
>
>
>
>
> On Wed, Feb 15, 2012 at 10:07 PM, Xiaoyu Yan <
yanxiaoyu...@gmail.com> wrote:
> > **