Re: [R] Plot in real unit (1:1)

2018-10-08 Thread Christian Brandstätter
Dar Jim, late, but it works now perfectly. I made a little function for autoscaling elevation data. https://stackoverflow.com/questions/50606797/plot-in-real-units-mm/52696705#52696705The (paper-)printer typically also autoscales, which needs to be deactivated. Example for a plot with scale

Re: [R] Plot in real unit (1:1)

2018-06-07 Thread Eik Vettorazzi
How about this: in2mm<-25.4 # scale factor to convert inches to mm pdf("test.pdf",width=8.3,height=11.7) pin<-par("pin") plot(c(0,pin[1]*in2mm),c(0,pin[2]*in2mm), type="n", xaxs="i", yaxs="i") lines(c(10,10),c(0,10)) text(11,5,"1 cm", adj=0) lines(c(0,40),c(20,20)) text(20,24,"4 cm")

Re: [R] Plot in real unit (1:1)

2018-06-06 Thread Brandstätter Christian
Thanks a lot! Jim Lemon schrieb am Do., 7. Juni 2018, 06:13: > Hi Christian, > Well, it almost worked. I suspect that the postscript device adds some > padding to account for the printable area, so with a bit of > experimentation, The following example seems to do what you want. When > I

Re: [R] Plot in real unit (1:1)

2018-06-06 Thread Jim Lemon
Hi Christian, Well, it almost worked. I suspect that the postscript device adds some padding to account for the printable area, so with a bit of experimentation, The following example seems to do what you want. When I printed the resulting file from the GIMP, the box and diamond were the correct

Re: [R] Plot in real unit (1:1)

2018-06-06 Thread Jim Lemon
Hi Christian, When I have to do something like this, I usually write it in Postscript using this: /def mm 2.8346 mul that converts a dimension in mm to points (1/72 inch). However, this won't work in R. It may be possible to set up the device like this: postscript("myfile.ps",paper="a4")

[R] Plot in real unit (1:1)

2018-06-06 Thread Christian Brandstätter
Dear List, Is it possible to plot in R in "real" units? I would like to draw a plot on A4 paper, where 1 plot unit would be a mm in reality. Is something like that possible? I would also like to be able to scale the plot in x and y direction. Background: For a project I would have to draw