diff options
Diffstat (limited to 'info/drawing-with-metapost/src/numbered-axes.mp')
-rw-r--r-- | info/drawing-with-metapost/src/numbered-axes.mp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/info/drawing-with-metapost/src/numbered-axes.mp b/info/drawing-with-metapost/src/numbered-axes.mp new file mode 100644 index 0000000000..47ee8f4ec9 --- /dev/null +++ b/info/drawing-with-metapost/src/numbered-axes.mp @@ -0,0 +1,27 @@ +\documentclass{standalone} +\usepackage{luamplib} +\usepackage{dwmpcode} +\begin{document} +\mplibtextextlabel{enable} +\begin{mplibcode} +beginfig(1); + numeric u, v; u = 40; v = 29; + path xx, yy; + xx = (3/2 left -- 5 right) scaled u; + yy = (3/2 down -- 4 up) scaled v; + for x=-1, 1, 2, 3, 4: + draw yy shifted (x * u, 0) withcolor 7/8; % grid + draw (down--up) shifted (x * u, 0); % ticks + label("$" & decimal x & "$", (x * u, -8)); + endfor + for y=-1, 1, 2, 3: + draw xx shifted (0, y * v) withcolor 7/8; % grid + draw (left--right) shifted (0, y * v); % ticks + label("$" & decimal y & "$", (-10, y * v)); + endfor + drawarrow xx; label.rt("$x$", point 1 of xx); + drawarrow yy; label.top("$y$", point 1 of yy); +endfig; +\end{mplibcode} +\end{document} + |