Note that there are some explanatory texts on larger screens.

plurals
  1. POprinting and graphics[]
    text
    copied!<p>I would like to draw a rectangle (or more) which printed on paper shows the rectangle in units of cm. So</p> <pre><code>Graphics[{Rectangle[{0, 0}, {19, 28}], Orange, Rectangle[{0, 0}, {1, 1}]}] </code></pre> <p>will print out as two rectangles which can be measured as exactly 1cm x 1cm (orange one) and the black one as 19x28 cm. </p> <p>It seems that some variables are important: The <code>ImageSize</code> and of course the <code>AspectRatio</code>.</p> <p>I used <code>AspectRatio-&gt;19/28</code> and for the <code>ImageSize</code> various settings like <code>ImageSize-&gt;{19*27,28*27}</code> but it keeps being not very accurate. </p> <p>I export the graphics to TIFF and then print out with windows photo gallery to a full page photo. Does anyone have experience with this? There must be a formula instead of trial and error.</p> <p>UPDATE: I tried the suggestion of @Szabolcs and I used the following code:</p> <pre><code> g = Graphics[{White, EdgeForm[Directive[Thick, Black]], Rectangle[{0, 0}, {18, 28}], Orange, Rectangle[{0, 0}, {10, 10}]}] final = Show[g, AspectRatio -&gt; Automatic, PlotRange -&gt; {{-0.5, 18.5}, {-0.5, 28.5}}] cm = 72/2.54 Export["final.pdf", Show[final, ImageSize -&gt; {19 cm, 29 cm}]] </code></pre> <p>This works great. The orange rectangle of 10x10cm is when measured exactly 10x10cm</p> <p>the cm 72/2.54 value was not what I expected since I though Windows uses 96dpi and Mac 72dpi (reading from the www). However 72 is the value that works. I've also beenn playing with the frames but then it gets ugly. Haven't found a way to get the right results dispite playing with all possible settings. What should work is create the frames/ticks etc myself inside the selected boundaries but that's not the path I would like to pursue..</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload