summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/mfpic/examples
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2009-11-25 21:47:49 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2009-11-25 21:47:49 +0000
commit10448afa6c23c9403daf4f67ebd5d01b556b531a (patch)
tree3b3708480f44540b1e076379209c8dea7a098f88 /Master/texmf-dist/doc/generic/mfpic/examples
parent69aadba877d0390d6f7305803b6bb80bd5251c0d (diff)
mfpic update (1.02 2009/10/29)
Also prevent ctan2tds from using MAKEflatten with a tds-ready tree. git-svn-id: svn://tug.org/texlive/trunk@16164 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/mfpic/examples')
-rw-r--r--Master/texmf-dist/doc/generic/mfpic/examples/data.dat37
-rw-r--r--Master/texmf-dist/doc/generic/mfpic/examples/forfun.tex160
-rw-r--r--Master/texmf-dist/doc/generic/mfpic/examples/lapictures.tex206
-rw-r--r--Master/texmf-dist/doc/generic/mfpic/examples/pictures.tex204
4 files changed, 607 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/mfpic/examples/data.dat b/Master/texmf-dist/doc/generic/mfpic/examples/data.dat
new file mode 100644
index 00000000000..e1b61e08d80
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/mfpic/examples/data.dat
@@ -0,0 +1,37 @@
+### File: data.dat
+### A part of mfpic 1.02 2009/10/29
+###
+# A file of data to plot a function curve
+# ("#", not "%", must be comment character when this is read.)
+
+
+#
+-10% 11.68# This is a comment
+ -9% 9.62
+ -8.5% 8.445
+ -8% 8.28
+ -7.5% 5.865 unused: random list, of, words,,,
+ -7% 5.5
+# This is not a blank line
+ -5.5% 3.445
+ -5% 1
+ -4.5% 1.965
+ -4% 2.14
+ -3.5% 2.985
+ -2.5% -1.215
+ -2% 1.52
+ -0.5% 1.545
+ 0% 0.42
+ 0.5% -0.435
+ 1% 0.96
+ 2.5% -1.235
+ 3% 0.94
+ 3.5% 0.165
+ 4% 0.28
+ 5% 1.1
+ 5.5% 3.145
+ 6% 1.94
+ 6.5% 5.505
+ 7% 3.44
+ 9.5% 8.925
+ 10% 9.84
diff --git a/Master/texmf-dist/doc/generic/mfpic/examples/forfun.tex b/Master/texmf-dist/doc/generic/mfpic/examples/forfun.tex
new file mode 100644
index 00000000000..31c3acd5953
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/mfpic/examples/forfun.tex
@@ -0,0 +1,160 @@
+%%% File: forfun.tex
+%%% A part of mfpic 1.02 2009/10/29
+%%%
+\nopagenumbers
+\input mfpic.tex
+\usemetapost
+\usetruebbox
+\opengraphsfile{fun}
+
+\mfpicunit=1bp
+
+\noindent
+\mfpic{-1.25}{118.5}{-11.25}{40}
+%
+% "meta"-ness:
+%
+\mfsrc{h:=25; % height of "m" These are graph units
+ s:=10; % width of stems
+}
+%
+% Calculate key points:
+%
+% "m"
+%
+\mfsrc{%
+ z1=(0,0);
+ y1=y2=y5=y6=y9=y10;
+ x2-x1=x6-x5=x10-x9=s;
+ x6-x1=x10-x5=h;
+ z15-z1=z3-z2=z4-z5=z7-z6=z8-z9=z11-z10=(0,h/2);
+ y12=y1+h; x12=.5[x6,x9];
+ y14=y12; x14=.5[x2,x5];
+ z13= arcppp(z7,z14,z15) intersectionpoint arcppp(z11,z12,z4);}
+%
+% "f"
+%
+\mfsrc{%
+ z21=z10; % start "f" at "m"'s end
+ z22=z21+(s,0);
+ z23=z22+(0,h-s);
+ z24=z23+(3s/4,0);
+ z25=z24+(0,s);
+ z26=z23+(0,s);
+ z27=z26+(0,s/4);
+ z28=z27+(s/4,0)+ (s/4)*dir(30);
+ z29=z28+s*dir(30);
+ x30=x21; y30=y27;}%
+%
+% "p"
+%
+\mfsrc{%
+ x31=x24;
+ y31=y21;
+ z32=z31-(0,s);
+ z33=z32+(s,0);
+ z35=(x33,h/2);
+ z39=z31+(h,h)/2; %center of round part
+ z34=(z33--z35) intersectionpoint (fullcircle scaled h shifted z39);
+ z36=z39+(h/2,0);
+ z37=z31+(0,h/2);}%
+%
+% "i"
+%
+\mfsrc{%
+ z41=(x36,y31);
+ z42=z41+(s,0);
+ z43=z42+(0,h);
+ z44=z41+(0,h);
+ x45=0.5[x41,x42]; y45=y43 + s/2 +3/50;}% Center of dot
+%
+% "c"
+%
+\mfsrc{%
+ z51=z42;
+ z52=z51+(h,h)/2; %center
+ z53=z52+(h/2)*dir(15);
+ z54=z52-(h/2,0);
+ z55=z52+(h/2)*dir(-15);
+ z56=z52+(s/4)*dir(-15);
+ z57=z52-(s/4,0);
+ z58=z52+(s/4)*dir(15);}%
+%
+\penwd{2.5*\the\mfpicunit}
+\mfsrc{%
+%
+% Calculate bounding box
+%
+% Need to account for half the thickness of pen;
+% penwd is in absolute units so we need to convert.
+% This is a displacement, so use invvconv (not invzconv):
+ begingroup
+ save border,ll,ur;
+ pair border,ll,ur; border:= invvconv((penwd,penwd))/2;
+ ll=(0,y32)-border;
+ ur=(x55,y27+5s/4)+border;}
+%
+\gfill[yellow]\rect{ll,ur} % background
+\mfsrc{endgroup;}
+%
+\fillcolor{blue}
+\drawcolor{green}
+%
+% "m"
+\mftitle{m}
+\draw\gfill\lclosed
+ \connect
+ \lines{z15,z1,z2,z3}
+ \arc[s]{z3,z4,-180}
+ \lines{z4,z5,z6,z7}
+ \arc[s]{z7,z8,-180}
+ \lines{z8,z9,z10,z11}
+ \arc[t]{z11,z12,z13}
+ \arc[t]{z13,z14,z15}
+ \endconnect
+%
+% "f"
+\mftitle{f}
+\draw\gfill\lclosed
+ \connect
+ \lines{z21,z22,z23,z24,z25,z26,z27}
+ \arc[s]{z27,z28,-150}
+ \lines{z28,z29}
+ \arc[s]{z29,z30,150}
+ \endconnect
+%
+% "p"
+\mftitle{p}
+\draw\gfill\lclosed
+ \connect
+ \lines{z31,z32,z33,z34}
+ \arc[t]{z34,z36,z37}
+ \endconnect
+\draw\gfill[yellow]\circle{z39,(h/2-s)}
+%
+% "i"
+\mftitle{i}
+\draw\gfill\polygon{z41,z42,z43,z44}
+\draw\gfill\circle{z45,s/2}
+%
+% "c"
+\mftitle{c}
+\draw\gfill\lclosed
+ \connect
+ \arc[t]{z53,z54,z55}
+ \arc[t]{z56,z57,z58}
+ \endconnect
+% uncoment to exhibit the points
+%\pointsize2bp
+%\pointfillfalse
+%\penwd{.2pt}
+%\point{z1,z2,z3,z4,z5,z6,z7,z8,z9,z10,z11,z12,z13,z14}
+%\point{z21,z22,z23,z24,z25,z26,z27,z28,z29,z30}
+%\point{z31,z32,z33,z34,z35,z36,z37}
+%\point{z41,z42,z43,z44,z45}
+%\point{z51,z52,z53,z54,z55,z56,z57,z58}
+% done
+\endmfpic
+
+\closegraphsfile % {fun}
+\bye
diff --git a/Master/texmf-dist/doc/generic/mfpic/examples/lapictures.tex b/Master/texmf-dist/doc/generic/mfpic/examples/lapictures.tex
new file mode 100644
index 00000000000..7de2656d1b1
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/mfpic/examples/lapictures.tex
@@ -0,0 +1,206 @@
+%%% File: lapictures.tex
+%%% A part of mfpic 1.02 2009/10/29
+%%%
+% Magnify to same scale as pictures.tex :
+% (Use of \mag is against the law of LaTeX, but Bugs Bunny set a precedent.)
+\mag=1200
+\documentclass{article}
+
+%%!!!!!!!!!!!!!!!!!!!!!!!!!!!
+% adjust these to your liking:
+\setlength{\paperheight}{11truein}
+\setlength{\paperwidth}{8.5truein}
+
+% Default plainTeX margins
+\setlength{\textwidth}{\paperwidth}
+\addtolength{\textwidth}{-2truein}
+\setlength{\textheight}{\paperheight}
+\addtolength{\textheight}{-2.1truein}
+\setlength{\headheight}{0in}
+\setlength{\headsep}{0in}
+\setlength{\oddsidemargin}{0in}
+\setlength{\evensidemargin}{\oddsidemargin}
+\setlength{\footskip}{\baselineskip}
+
+% Use the metafont option if you prefer.
+\usepackage[metapost,raggedcaptions]{mfpic}
+
+\ifx\pdfoutput\UndEfInEd
+\else
+ \setlength{\pdfpageheight}{\paperheight}
+ \setlength{\pdfpagewidth}{\paperwidth}
+\fi
+
+\opengraphsfile{pics}
+
+\setlength{\mfpframesep}{0pt}
+\headshape{1}{1}{true}
+\newcommand{\vs}{\bigskip\filbreak}
+%\renewcommand\raggedright{\rightskip 0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}
+\begin{document}
+\mftitle{Commutative Diagram example.}
+
+% A-----D
+% |\ /|
+% | C-F |
+% |/ \|
+% B.....E
+
+\noindent
+\begin{mfpframe}
+\begin{mfpic}[12]{0}{10}{0}{10}
+\tlabeljustify{cc}
+\tcaption[2.0,1.0]{{\it Figure 1:} Commutative diagram example.}
+\tlabels{(1,9){A}
+ (1,1){B}
+ (3,5){C}
+ (9,9){D}
+ (9,1){E}
+ (7,5){F}}
+\setrender{\arrow\draw\trimpath{6pt}}
+\lines{(1,9), (1,1)} % A -> B.
+\lines{(1,9), (3,5)} % A -> C.
+\lines{(3,5), (1,1)} % C -> B.
+\lines{(1,9), (9,9)} % A -> D.
+\lines{(9,9), (9,1)} % D -> E.
+\lines{(9,9), (7,5)} % D -> F.
+\lines{(7,5), (9,1)} % F -> E.
+\lines{(3,5), (7,5)} % C -> F.
+% B- - ->E :
+%\dotted\arrow[r90][b-12pt]\arrow[b15pt]\reverse\arrow\lines{(1.5,1), (8.5,1)}
+\arrow\arrow[b10pt]\reverse\arrow\dotted\trimpath{6pt}\lines{(1,1), (9,1)}
+\end{mfpic}
+\end{mfpframe}
+
+\vs
+
+\mftitle{Function Plot with Cartesian Axes.}
+
+\noindent
+\begin{mfpframe}
+\begin{mfpic}[20]{-3}{3}{-3}{3}
+\axes
+\function{-2,2,0.1}{((x**3)-x)/3}
+\tcaption{{\it Figure 2:} Function Plot with Cartesian Axes.}
+\end{mfpic}
+\end{mfpframe}
+
+\vs
+
+\mftitle{Parametric Function Plot, and Filled Circle.}
+
+\noindent
+\begin{mfpframe}
+\begin{mfpic}[30]{-1.5}{1.5}{-1}{1}
+\parafcn{0,6,0.1}{cosd(150t)*dir(90t)}
+\gfill\circle{(0,0),0.25}
+\tcaption{{\it Figure 3:} Parametric Function Plot, and Filled Circle.}
+\end{mfpic}
+\end{mfpframe}
+
+\vs
+
+\mftitle{Bar Graph.}
+
+\noindent
+\begin{mfpframe}
+\begin{mfpic}[20]{-0.5}{4}{-0.5}{4}
+\axes
+\shade\draw\rect{(0,0),(1,0.5)}
+\darkershade
+\shade\draw\rect{(1,0),(2,1)}
+\hatch\draw\rect{(2,0),(3,2)}
+\tcaption{{\it Figure 4:} Bar Graph.}
+\end{mfpic}
+\end{mfpframe}
+
+\vs
+
+\mftitle{Pie Chart.}
+
+\noindent
+\begin{mfpframe}
+\begin{mfpic}[30]{-1.3}{1.7}{-1}{1.1}
+\gfill\sector{(0.3,0.2), 1, 0,60}
+\shade\sector{(0,0), 1, 60,105}
+\turtle{(0,0), \plr{(1,105)}}
+\sector{(0,0), 1, 60,360}
+\tcaption{{\it Figure 5:} Pie Chart.}
+\end{mfpic}
+\end{mfpframe}
+
+\noindent Unindented text here.
+
+\vs
+
+\mftitle{Circle with Arrow.}
+
+\noindent
+\begin{mfpframe}
+\begin{mfpic}[20]{-2}{2}{-1}{1}
+\arrow\circle{(0,0),1}
+\tcaption{{\it Figure 6:} Circle with Arrow.}
+\end{mfpic}
+\end{mfpframe}
+
+\vs
+
+\mftitle{Use of hatch, draw, lclosed, connect, curve, point, lines,
+ dotted, reverse.}
+
+\noindent
+\begin{mfpframe}
+\begin{mfpic}[20]{-3}{3}{-3}{3}
+\hatch\draw\lclosed\connect
+\curve{(1,0), (1,0.5), (1,1), (0,1.5)}
+\point{(0,0)}
+\endconnect
+\lines{(-1,1), (-1,-1), (1,-1.5)}
+\point{(0,0)}
+\dotted\reverse\lines{(-2,2), (-2,-2), (2,-3)}
+\tcaption{{\it Figure 7:} Use of hatch, draw, lclosed, connect,
+ curve, point, lines, dotted, reverse.}
+\end{mfpic}
+\end{mfpframe}
+
+\vs
+
+\mftitle{Simpler variant of the previous figure.}
+
+\noindent
+\begin{mfpframe}
+\begin{mfpic}[40]{-1}{1}{-1}{1} % Was `[20]'.
+\tcaption{{\it Figure 8:} Simpler variant of the previous figure.}
+\hatch\draw\lclosed\connect
+\curve{(1,0), (0.5,0.25), (0.5,0.5), (0,0.75)}
+\point{(0,0)}
+\endconnect
+\reverse\lines{(-0.5,0.5), (-0.5,-0.5), (0.5,-0.75)}
+\tcaption{{\it Figure 8:} Simpler variant of the previous figure.}
+\end{mfpic}
+\end{mfpframe}
+
+\vs
+
+\mftitle{Graph of data from file.}
+
+\noindent
+\begin{mfpframe}
+\begin{mfpic}[6]{-10}{10}{-2}{12}
+ \makepercentother
+ \using{#1% #2 #3}{(#1,#2)}
+ \makepercentcomment
+ \mfpdatacomment\#
+ \fcncurve\datafile{data.dat}
+ \axes
+\tcaption{{\it Figure 9:} Example of a graph drawn from data in a file}
+\end{mfpic}
+\end{mfpframe}
+
+\closegraphsfile
+
+\end{document}
+
+%%%
+%%% EOF lapictures.tex
+%%%
diff --git a/Master/texmf-dist/doc/generic/mfpic/examples/pictures.tex b/Master/texmf-dist/doc/generic/mfpic/examples/pictures.tex
new file mode 100644
index 00000000000..493de537393
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/mfpic/examples/pictures.tex
@@ -0,0 +1,204 @@
+%%% File: pictures.tex
+%%% A part of mfpic 1.02 2009/10/29
+%%%
+\magnification=\magstep1
+
+\newdimen\paperheight
+\newdimen\paperwidth
+%%!!!!!!!!!!!!!!!!!!!!!!!!!!!
+% adjust these to your liking:
+\paperheight 11truein
+\paperwidth 8.5truein
+
+% Default plainTeX margins
+\hsize \paperwidth
+\advance\hsize -2 truein
+\hoffset 0 truein
+%
+\vsize\paperheight
+\advance\vsize -2.1 truein
+\voffset 0 truein
+
+\input mfpic
+%% Comment this if you prefer metafont:
+\usemetapost
+\useraggedcaptions
+\ifx\pdfoutput\UndEfInEd
+\else
+ \pdfpageheight=\paperheight
+ \pdfpagewidth=\paperwidth
+\fi
+
+\opengraphsfile{pics}
+
+\mfpframesep0pt
+\headshape{1}{1}{true}
+
+\def\vs{\bigskip\filbreak}
+
+\mftitle{Commutative Diagram example.}
+
+% A-----D
+% |\ /|
+% | C-F |
+% |/ \|
+% B.....E
+
+\noindent
+\mfpframe
+\mfpic[12]{0}{10}{0}{10}
+\tlabeljustify{cc}
+\tcaption[2.0,1.0]{{\it Figure 1:} Commutative diagram example.}
+\tlabels{(1,9){A}
+ (1,1){B}
+ (3,5){C}
+ (9,9){D}
+ (9,1){E}
+ (7,5){F}}
+\setrender{\arrow\draw\trimpath{6pt}}
+\lines{(1,9), (1,1)} % A -> B.
+\lines{(1,9), (3,5)} % A -> C.
+\lines{(3,5), (1,1)} % C -> B.
+\lines{(1,9), (9,9)} % A -> D.
+\lines{(9,9), (9,1)} % D -> E.
+\lines{(9,9), (7,5)} % D -> F.
+\lines{(7,5), (9,1)} % F -> E.
+\lines{(3,5), (7,5)} % C -> F.
+% B- - ->E :
+\arrow\arrow[b10pt]\reverse\arrow\dotted\trimpath{6pt}\lines{(1,1), (9,1)}
+\endmfpic
+\endmfpframe
+
+\vs
+
+\mftitle{Function Plot with Cartesian Axes.}
+
+\noindent
+\mfpframe
+\mfpic[20]{-3}{3}{-3}{3}
+\axes
+\function{-2,2,0.1}{((x**3)-x)/3}
+\tcaption{{\it Figure 2:} Function Plot with Cartesian Axes.}
+\endmfpic
+\endmfpframe
+
+\vs
+
+\mftitle{Parametric Function Plot, and Filled Circle.}
+
+\noindent
+\mfpframe
+\mfpic[30]{-1.5}{1.5}{-1}{1}
+\parafcn{0,6,0.1}{cosd(150t)*dir(90t)}
+\gfill\circle{(0,0),0.25}
+\tcaption{{\it Figure 3:} Parametric Function Plot, and
+Filled Circle.}
+\endmfpic
+\endmfpframe
+
+\vs
+
+\mftitle{Bar Graph.}
+
+\noindent
+\mfpframe
+\mfpic[20]{-0.5}{4}{-0.5}{4}
+\axes
+\shade\draw\rect{(0,0),(1,0.5)}
+\darkershade
+\shade\draw\rect{(1,0),(2,1)}
+\hatch\draw\rect{(2,0),(3,2)}
+\tcaption{{\it Figure 4:} Bar Graph.}
+\endmfpic
+\endmfpframe
+
+\vs
+
+\mftitle{Pie Chart.}
+
+\noindent
+\mfpframe
+\mfpic[30]{-1.3}{1.7}{-1}{1.1}
+\gfill\sector{(0.3,0.2), 1, 0,60}
+\shade\sector{(0,0), 1, 60,105}
+\turtle{(0,0), \plr{(1,105)}}
+\sector{(0,0), 1, 60,360}
+\tcaption{{\it Figure 5:} Pie Chart.}
+\endmfpic
+\endmfpframe
+
+\noindent Unindented text here.
+
+\vs
+
+\mftitle{Circle with Arrow.}
+
+\noindent
+\mfpframe
+\mfpic[20]{-2}{2}{-1}{1}
+\arrow\circle{(0,0),1}
+\tcaption{{\it Figure 6:} Circle with Arrow.}
+\endmfpic
+\endmfpframe
+
+\vs
+
+\mftitle{Use of hatch, draw, lclosed, connect, curve, point, lines,
+ dotted, reverse.}
+
+\noindent
+\mfpframe
+\mfpic[20]{-3}{3}{-3}{3}
+\hatch\draw\lclosed\connect
+\curve{(1,0), (1,0.5), (1,1), (0,1.5)}
+\point{(0,0)}
+\endconnect
+\lines{(-1,1), (-1,-1), (1,-1.5)}
+\point{(0,0)}
+\dotted\reverse\lines{(-2,2), (-2,-2), (2,-3)}
+\tcaption{{\it Figure 7:} Use of hatch, draw, lclosed, connect,
+ curve, point, lines, dotted, reverse.}
+\endmfpic
+\endmfpframe
+
+\vs
+
+\mftitle{Simpler variant of the previous figure.}
+
+\noindent
+\mfpframe
+\mfpic[40]{-1}{1}{-1}{1} % Was `[20]'.
+\tcaption{{\it Figure 8:} Simpler variant of the previous figure.}
+\hatch\draw\lclosed\connect
+\curve{(1,0), (0.5,0.25), (0.5,0.5), (0,0.75)}
+\point{(0,0)}
+\endconnect
+\reverse\lines{(-0.5,0.5), (-0.5,-0.5), (0.5,-0.75)}
+\tcaption{{\it Figure 8:} Simpler variant of the previous figure.}
+\endmfpic
+\endmfpframe
+
+\vs
+
+\mftitle{Graph of data from file.}
+
+\noindent
+\mfpframe
+\mfpic[6]{-10}{10}{-2}{12}
+ \makepercentother
+ \using{#1% #2 #3}{(#1,#2)}
+ \makepercentcomment
+ \mfpdatacomment\#
+ \fcncurve\datafile{data.dat}
+ \axes
+\tcaption{{\it Figure 9:} Example of a graph drawn from data in a file}
+\endmfpic
+\endmfpframe
+
+\closegraphsfile
+
+\end
+
+%%%
+%%% EOF pictures.tex
+%%%