postscript bounding box in trellis/lattice plot is wrong ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

postscript bounding box in trellis/lattice plot is wrong ?

context grey
Hi,  a problem involving postscript bounding boxes:

I'm composing three scatterplots into a single figure,
postsript for publication.

The individual scatterplots should be square, so
the overall figure should have a roughly 1:3 sort of
aspect ratio.

By default however, the overall figure comes out
nearly square,
and the scatterplots are stretched vertically.

I fixed this by adding "aspect=1/1" to the individual
xyplot()
calls.  This produces a figure that looks correct.
 
However, the bounding box for the figure leaves way
too much
space above and below... as if it is still assuming
that the
figure is square rather than 1:3 in proportions.


Is there any fix for this?   Thanks for any advice

Here's the approximate code (very simple):
------------------------------------

library(lattice)

    plt_hi[[1]] <- xyplot(thedat[,ir] ~ thedat[,ic],
aspect=1/1)
...
    plt_hi[[2]] <- xyplot(thedat[,ir] ~ thedat[,ic],
aspect=1/1)
...
    plt_hi[[2]] <- xyplot(thedat[,ir] ~ thedat[,ic],
aspect=1/1)

trellis.device(postscript, file=thefile, color=F)
print(plt_hi[[1]], split=c(1,1,3,1), more=T)
print(plt_hi[[2]], split=c(2,1,3,1), more=T)
print(plt_hi[[3]], split=c(3,1,3,1), more=F)
dev.off()

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: postscript bounding box in trellis/lattice plot is wrong ?

Deepayan Sarkar
On 3/1/06, context grey <[hidden email]> wrote:

> Hi,  a problem involving postscript bounding boxes:
>
> I'm composing three scatterplots into a single figure,
> postsript for publication.
>
> The individual scatterplots should be square, so
> the overall figure should have a roughly 1:3 sort of
> aspect ratio.
>
> By default however, the overall figure comes out
> nearly square,
> and the scatterplots are stretched vertically.
>
> I fixed this by adding "aspect=1/1" to the individual
> xyplot()
> calls.  This produces a figure that looks correct.
>
> However, the bounding box for the figure leaves way
> too much
> space above and below... as if it is still assuming
> that the
> figure is square rather than 1:3 in proportions.
>
>
> Is there any fix for this?   Thanks for any advice
>
> Here's the approximate code (very simple):
> ------------------------------------
>
> library(lattice)
>
>     plt_hi[[1]] <- xyplot(thedat[,ir] ~ thedat[,ic],
> aspect=1/1)
> ...
>     plt_hi[[2]] <- xyplot(thedat[,ir] ~ thedat[,ic],
> aspect=1/1)
> ...
>     plt_hi[[2]] <- xyplot(thedat[,ir] ~ thedat[,ic],
> aspect=1/1)
>
> trellis.device(postscript, file=thefile, color=F)

For starters, you should heed the advice in ?postscript:

     The postscript produced for a single R plot is EPS (_Encapsulated
     PostScript_) compatible, and can be included into other documents,
     e.g., into LaTeX, using '\includegraphics{<filename>}'.  For use
     in this way you will probably want to set 'horizontal = FALSE,
     onefile = FALSE, paper = "special"'.

> print(plt_hi[[1]], split=c(1,1,3,1), more=T)
> print(plt_hi[[2]], split=c(2,1,3,1), more=T)
> print(plt_hi[[3]], split=c(3,1,3,1), more=F)
> dev.off()


Deepayan
--
http://www.stat.wisc.edu/~deepayan/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Loading...