Debian Codegraph @

texmf-dist/doc/generic/mfpic/examples/lapictures.tex

raw
1 % File: lapictures.tex
2 % A part of mfpic 1.10 2012/12/03
3 %
4 % Magnify to same scale as pictures.tex :
5 % (Use of \mag is against the law of LaTeX, but Bugs Bunny set a precedent.)
6 \mag=1200
7 \documentclass{article}
8
9 %%!!!!!!!!!!!!!!!!!!!!!!!!!!!
10 % adjust these to your liking:
11 \setlength{\paperheight}{11truein}
12 \setlength{\paperwidth}{8.5truein}
13
14 % Default plainTeX margins
15 \setlength{\textwidth}{\paperwidth}
16 \addtolength{\textwidth}{-2truein}
17 \setlength{\textheight}{\paperheight}
18 \addtolength{\textheight}{-2.1truein}
19 \setlength{\headheight}{0in}
20 \setlength{\headsep}{0in}
21 \setlength{\oddsidemargin}{0in}
22 \setlength{\evensidemargin}{\oddsidemargin}
23 \setlength{\footskip}{\baselineskip}
24
25 % Use the metafont option if you prefer.
26 \usepackage[metapost,raggedcaptions]{mfpic}
27
28 \ifx\pdfoutput\UndEfInEd
29 \else
30 \setlength{\pdfpageheight}{\paperheight}
31 \setlength{\pdfpagewidth}{\paperwidth}
32 \fi
33
34 \opengraphsfile{pics}
35
36 \setlength{\mfpframesep}{0pt}
37 \headshape{1}{1}{true}
38 \newcommand{\vs}{\bigskip\filbreak}
39 %\renewcommand\raggedright{\rightskip 0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}
40 \begin{document}
41 \mftitle{Commutative Diagram example.}
42
43 % A-----D
44 % |\ /|
45 % | C-F |
46 % |/ \|
47 % B.....E
48
49 \noindent
50 \begin{mfpframe}
51 \begin{mfpic}[12]{0}{10}{0}{10}
52 \tlabeljustify{cc}
53 \tcaption[2.0,1.0]{{\it Figure 1:} Commutative diagram example.}
54 \tlabels{(1,9){A}
55 (1,1){B}
56 (3,5){C}
57 (9,9){D}
58 (9,1){E}
59 (7,5){F}}
60 \setrender{\arrow\draw\trimpath{6pt}}
61 \lines{(1,9), (1,1)} % A -> B.
62 \lines{(1,9), (3,5)} % A -> C.
63 \lines{(3,5), (1,1)} % C -> B.
64 \lines{(1,9), (9,9)} % A -> D.
65 \lines{(9,9), (9,1)} % D -> E.
66 \lines{(9,9), (7,5)} % D -> F.
67 \lines{(7,5), (9,1)} % F -> E.
68 \lines{(3,5), (7,5)} % C -> F.
69 % B- - ->E :
70 %\dotted\arrow[r90][b-12pt]\arrow[b15pt]\reverse\arrow\lines{(1.5,1), (8.5,1)}
71 \arrow\arrow[b10pt]\reverse\arrow\dotted\trimpath{6pt}\lines{(1,1), (9,1)}
72 \end{mfpic}
73 \end{mfpframe}
74
75 \vs
76
77 \mftitle{Function Plot with Cartesian Axes.}
78
79 \noindent
80 \begin{mfpframe}
81 \begin{mfpic}[20]{-3}{3}{-3}{3}
82 \axes
83 \function{-2,2,0.1}{((x**3)-x)/3}
84 \tcaption{{\it Figure 2:} Function Plot with Cartesian Axes.}
85 \end{mfpic}
86 \end{mfpframe}
87
88 \vs
89
90 \mftitle{Parametric Function Plot, and Filled Circle.}
91
92 \noindent
93 \begin{mfpframe}
94 \begin{mfpic}[30]{-1.5}{1.5}{-1}{1}
95 \parafcn{0,6,0.1}{cosd(150t)*dir(90t)}
96 \gfill\circle{(0,0),0.25}
97 \tcaption{{\it Figure 3:} Parametric Function Plot, and Filled Circle.}
98 \end{mfpic}
99 \end{mfpframe}
100
101 \vs
102
103 \mftitle{Bar Graph.}
104
105 \noindent
106 \begin{mfpframe}
107 \begin{mfpic}[20]{-0.5}{4}{-0.5}{4}
108 \axes
109 \shade\draw\rect{(0,0),(1,0.5)}
110 \darkershade
111 \shade\draw\rect{(1,0),(2,1)}
112 \hatch\draw\rect{(2,0),(3,2)}
113 \tcaption{{\it Figure 4:} Bar Graph.}
114 \end{mfpic}
115 \end{mfpframe}
116
117 \vs
118
119 \mftitle{Pie Chart.}
120
121 \noindent
122 \begin{mfpframe}
123 \begin{mfpic}[30]{-1.3}{1.7}{-1}{1.1}
124 \gfill\sector{(0.3,0.2), 1, 0, 60}
125 \shade\sector{(0,0), 1, 60, 105}
126 \turtle{(0,0), \plr{(1, 105)}}
127 \sector{(0,0), 1, 60, 360}
128 \tcaption{{\it Figure 5:} Pie Chart.}
129 \end{mfpic}
130 \end{mfpframe}
131
132 \noindent Unindented text here.
133
134 \vs
135
136 \mftitle{Circle with Arrow.}
137
138 \noindent
139 \begin{mfpframe}
140 \begin{mfpic}[20]{-2}{2}{-1}{1}
141 \arrow\circle{(0,0),1}
142 \tcaption{{\it Figure 6:} Circle with Arrow.}
143 \end{mfpic}
144 \end{mfpframe}
145
146 \vs
147
148 \mftitle{Use of hatch, draw, lclosed, connect, curve, point, lines,
149 dotted, reverse.}
150
151 \noindent
152 \begin{mfpframe}
153 \begin{mfpic}[20]{-3}{3}{-3}{3}
154 \hatch\draw\lclosed\connect
155 \curve{(1,0), (1,0.5), (1,1), (0,1.5)}
156 \point{(0,0)}
157 \endconnect
158 \lines{(-1,1), (-1,-1), (1,-1.5)}
159 \point{(0,0)}
160 \dotted\reverse\lines{(-2,2), (-2,-2), (2,-3)}
161 \tcaption{{\it Figure 7:} Use of hatch, draw, lclosed, connect,
162 curve, point, lines, dotted, reverse.}
163 \end{mfpic}
164 \end{mfpframe}
165
166 \vs
167
168 \mftitle{Simpler variant of the previous figure.}
169
170 \noindent
171 \begin{mfpframe}
172 \begin{mfpic}[40]{-1}{1}{-1}{1} % Was `[20]'.
173 \tcaption{{\it Figure 8:} Simpler variant of the previous figure.}
174 \hatch\draw\lclosed\connect
175 \curve{(1,0), (0.5,0.25), (0.5,0.5), (0,0.75)}
176 \point{(0,0)}
177 \endconnect
178 \reverse\lines{(-0.5,0.5), (-0.5,-0.5), (0.5,-0.75)}
179 \tcaption{{\it Figure 8:} Simpler variant of the previous figure.}
180 \end{mfpic}
181 \end{mfpframe}
182
183 \vs
184
185 \mftitle{Graph of data from file.}
186
187 \noindent
188 \begin{mfpframe}
189 \begin{mfpic}[6]{-10}{10}{-2}{12}
190 \makepercentother
191 \using{#1% #2 #3}{(#1,#2)}
192 \makepercentcomment
193 \mfpdatacomment\#
194 \fcncurve\datafile{data.dat}
195 \axes
196 \tcaption{{\it Figure 9:} Example of a graph drawn from data in a file}
197 \end{mfpic}
198 \end{mfpframe}
199
200 \closegraphsfile
201
202 \end{document}
203
204 %%%
205 %%% EOF lapictures.tex
206 %%%