summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/m-graph.mkiv
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-12 17:15:07 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-12 17:15:07 +0100
commit8d8d528d2ad52599f11250cfc567fea4f37f2a8b (patch)
tree94286bc131ef7d994f9432febaf03fe23d10eef8 /tex/context/modules/mkiv/m-graph.mkiv
parentf5aed2e51223c36c84c5f25a6cad238b2af59087 (diff)
downloadcontext-8d8d528d2ad52599f11250cfc567fea4f37f2a8b.tar.gz
2016-01-12 16:26:00
Diffstat (limited to 'tex/context/modules/mkiv/m-graph.mkiv')
-rw-r--r--tex/context/modules/mkiv/m-graph.mkiv133
1 files changed, 133 insertions, 0 deletions
diff --git a/tex/context/modules/mkiv/m-graph.mkiv b/tex/context/modules/mkiv/m-graph.mkiv
new file mode 100644
index 000000000..62c4ec4cb
--- /dev/null
+++ b/tex/context/modules/mkiv/m-graph.mkiv
@@ -0,0 +1,133 @@
+%D \module
+%D [ file=m-graph,
+%D version=2008.09.08,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=\METAPOST\ graph module support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% We just assume lua specification instead of the graph ones that
+% are limited by what mp can do. We support @ as replacement for
+% the percent symbol. We also add a specifier when no one is given.
+
+\unprotect
+
+\defineMPinstance
+ [graph]
+ [\s!format=metafun,
+ \s!extensions=\v!yes,
+ \s!initializations=\v!yes,
+ \c!method=\s!double]
+
+\startMPdefinitions{graph}
+ if unknown context_grap : input mp-grap.mpiv ; fi ;
+\stopMPdefinitions
+
+\protect
+
+\continueifinputfile{m-graph.mkiv}
+
+%D We put this test here as in \type {meta-tex.mkiv} it would abort due to redefinition
+%D of namespaces.
+
+\starttext
+
+\startMPpage[instance=graph]
+ label.rt(format("@g","1e-8"), (0, 0)) ;
+ label.rt(format("@g","1e+8"), (2cm, 0)) ;
+ label.rt(format("@g","1e-10"), (0, -0.5cm)) ;
+ label.rt(format("@g","1e+10"), (2cm,-0.5cm)) ;
+ label.rt(format("@g","1e-12"), (0, -1.0cm)) ;
+ label.rt(format("@g","1e+12"), (2cm,-1.0cm)) ;
+ label.rt(format("@g","1e-0"), (0, -1.5cm)) ;
+ label.rt(format("@g","1e+0"), (2cm,-1.5cm)) ;
+ label.rt(format("@g","1"), (0, -2.0cm)) ;
+ label.rt(format("@g","1"), (2cm,-2.0cm)) ;
+ label.rt(format("@g","1e-102"),(0, -2.5cm)) ;
+ label.rt(format("@g","1e+102"),(2cm,-2.5cm)) ;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ %
+ label.rt(format("@j","1e-8"), (0, 0)) ;
+ label.rt(format("@j","1e+8"), (2cm, 0)) ;
+ label.rt(format("@j","1e-10"), (0, -0.5cm)) ;
+ label.rt(format("@j","1e+10"), (2cm,-0.5cm)) ;
+ label.rt(format("@j","1e-12"), (0, -1.0cm)) ;
+ label.rt(format("@j","1e+12"), (2cm,-1.0cm)) ;
+ label.rt(format("@j","1e-0"), (0, -1.5cm)) ;
+ label.rt(format("@j","1e+0"), (2cm,-1.5cm)) ;
+ label.rt(format("@j","1"), (0, -2.0cm)) ;
+ label.rt(format("@j","1"), (2cm,-2.0cm)) ;
+ label.rt(format("@j","1e-102"),(0, -2.5cm)) ;
+ label.rt(format("@j","1e+102"),(2cm,-2.5cm)) ;
+ label.rt(formatted("(@f,@f)",(1.23,4.56)),(0cm,-3.0cm)) ;
+ label.rt(formatted("(@i,@i)",(1.23,4.56)),(0cm,-3.5cm)) ;
+ label.rt(formatted("(@g,@g)",(1.23,4.56)),(0cm,-4.0cm)) ;
+ label.rt(formatted("(@e,@e)",(1.23,4.56)),(0cm,-4.5cm)) ;
+ label.rt(formatted("(@j,@j)",(1.23,4.56)),(0cm,-5.0cm)) ;
+\stopMPpage
+
+\stoptext
+
+% \startMPpage[instance=graph]
+% draw begingraph(3in,2in);
+% gdraw "t:/metapost/grphdata/agepop91.d";
+% endgraph;
+% \stopMPpage
+
+% \startMPpage[instance=graph]
+% draw begingraph(3in,2in);
+% gdraw "agepop91.d" plot btex $\bullet$ etex;
+% endgraph;
+% \stopMPpage
+
+% \startMPpage[instance=graph]
+% draw begingraph(3in,2in);
+% glabel.lft(btex \vbox{\hbox{Population} \hbox{in millions}} etex, OUT);
+% glabel.bot(btex Age in years etex, OUT);
+% gdraw "agepopm.d";
+% endgraph;
+% \stopMPpage
+
+% \startMPpage[instance=graph]
+% draw begingraph(3in,2in);
+% glabel.lft(btex \vbox{\hbox{Population} \hbox{in millions}} etex, OUT);
+% glabel.bot(btex Age in years etex, OUT);
+% setrange(origin, whatever,whatever);
+% gdraw "agepopm.d";
+% endgraph;
+% \stopMPpage
+
+% \startMPpage[instance=graph]
+% draw begingraph(2.3in,2in);
+% setcoords(log,log);
+% glabel.lft(btex Seconds etex,OUT);
+% glabel.bot(btex Matrix size etex,
+% OUT);
+% gdraw "matmul.d" dashed evenly;
+% glabel.ulft(btex Standard etex,8);
+% gdraw "matmul.d";
+% glabel.lrt(btex Strassen etex,7);
+% endgraph;
+% \stopMPpage
+
+% \startMPpage[instance=graph]
+% draw begingraph(6.5cm,4.5cm);
+% setrange(80,0, 90,whatever);
+% glabel.bot(btex Year etex, OUT);
+% glabel.lft(btex \vbox{\hbox{Emissions in} \hbox{thousands of}
+% \hbox{metric tons} \hbox{(heavy line)}}etex, OUT);
+% gdraw "lead.d" withpen pencircle scaled 1.5pt;
+% autogrid(,otick.lft);
+% setcoords(linear,linear);
+% setrange(80,0, 90,whatever);
+% glabel.rt(btex \vbox{\hbox{Micrograms} \hbox{per cubic}
+% \hbox{meter of air} \hbox{(thin line)}}etex, OUT);
+% gdraw "lead.d";
+% autogrid(otick.bot,otick.rt);
+% endgraph;
+% \stopMPpage