28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

288 Chapter 13. Drawing with L AT E X<br />

The coordinate numbers are generally positive, meaning that the point<br />

lies <strong>to</strong> the right <strong>and</strong> above the reference point. Since this point is the<br />

lower left corner of the picture, all other points should be more <strong>to</strong> the<br />

right <strong>and</strong> higher than it. However, negative values are also possible. A<br />

negative x value (a negative number for the first member of a coordinate<br />

pair) defines a point left of the origin, while a negative y value (the second<br />

member of the pair is negative) specifies a point below the reference point.<br />

y-axis<br />

✻<br />

1.4<br />

origin<br />

✠<br />

✛ UL ✲<br />

(1.8,1.4)<br />

✲ x-axis<br />

1.8<br />

(−2.2,1.8)<br />

<br />

negative coordinate values<br />

y<br />

✻<br />

<br />

(−1.8,−0.8)<br />

The unit length is selected with the comm<strong>and</strong><br />

\setlength{\unitlength}{length}<br />

<br />

✛UL✲ (3.0,2.0)<br />

<br />

<br />

(2.5,−1.0)<br />

✲ x<br />

In the left-h<strong>and</strong> example above, the unit length was set <strong>to</strong> a value of<br />

1.5 cm with the comm<strong>and</strong> \setlength{\unitlength}{1.5cm}. The<br />

point (1.8,1.4) then lies 1.8 times the unit length (= 2.7 cm) <strong>to</strong> the right,<br />

<strong>and</strong> 1.4 times (= 2.1 cm) above the origin. In the right-h<strong>and</strong> example, the<br />

unit length is set <strong>to</strong> 1 cm.<br />

The unit of length is normally set <strong>to</strong> a convenient size such as 1 cm,<br />

1 mm, or 1 in <strong>and</strong> the picture is built up accordingly. Once it has been<br />

completed, it is possible <strong>to</strong> rescale the whole thing simply by changing<br />

the value of the length unit. A picture that was originally designed with<br />

\unitlength set <strong>to</strong> 1 cm can be enlarged by a fac<strong>to</strong>r 1.2 by redefining its<br />

length unit <strong>to</strong> be 1.2 cm.<br />

13.1.2 The picture environment<br />

Pictures are constructed within the picture environment which is started<br />

with<br />

\begin{picture}(x dimen,y dimen)<br />

picture comm<strong>and</strong>s<br />

\end{picture}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!