KTUGFaq
KTUG FAQ
Expect a letter from a friend who will ask a favor of you.
FrontPage › Karnes/2009-07 › MetaPost/Graph
verbatimtex %&latex \documentclass{article} \usepackage{dhucs} \begin{document} etex; input graph;
beginfig(1); draw begingraph(12cm,8cm); gdraw "clitig.txt" ; gdotlabel.lft(btex IMF $\rightarrow$ etex, 45); endgraph; endfig;
beginfig(2); draw begingraph(12cm,8cm); gdraw "clitig.txt" withpen pencircle scaled 1.5pt; glabel.ulft(btex ¹Î»ç¼Ò¼Û etex, 43); glabel.bot(btex ¿¬µµ etex, OUT); glabel.lft(btex »ç°Ç¼ö etex rotated 90 ,OUT); endgraph; endfig;
beginfig(3); draw begingraph(12cm,8cm); gdraw "clitig.txt" withpen pencircle scaled 1.5pt; glabel.ulft(btex ¹Î»ç¼Ò¼Û etex, 43); gdraw "rgdp.txt" ; glabel.lrt(btex GDP etex, 45); glabel.bot(btex ¿¬µµ etex, OUT); glabel.lft(btex »ç°Ç¼ö/½Ê¾ï¿ø etex rotated 90 ,OUT); endgraph; endfig;
beginfig(4); draw begingraph(12cm,8cm); gdraw "clitig.txt" withpen pencircle scaled 1.5pt; glabel.lrt(btex ¹Î»ç¼Ò¼Û etex, 43); autogrid(,otick.lft); setcoords(linear,linear); gdraw "rgdp.txt" ; glabel.ulft(btex GDP etex, 40); autogrid(otick.bot,otick.rt); glabel.bot(btex ¿¬µµ etex, OUT); glabel.lft(btex ¹Î»ç¼Ò¼Û(°Ç¼ö) etex rotated 90 ,OUT); glabel.rt(btex ½ÇÁúGDP(½Ê¾ï¿ø) etex rotated -90 ,OUT); endgraph; endfig;
input sarith; beginfig(5); draw begingraph(12cm,8cm); path p[]; gdata("clitig.txt",$, if scantokens $1 >=1980: augment.p0($1,$2 Sdiv 1000); fi); gdata("rgdp.txt",$, if scantokens $1 >=1980: augment.p1($1,$2 Sdiv 1000); fi); gdraw p0 withpen pencircle scaled 1.5pt; glabel.lrt(btex ¹Î»ç¼Ò¼Û etex, 13); autogrid(,otick.lft); setcoords(linear,linear); gdraw p1 ; glabel.ulft(btex GDP etex, 15); autogrid(,otick.rt); for u=auto.x: otick.bot(format("%f",u),u); endfor; glabel.bot(btex ¿¬µµ etex, OUT); glabel.lft(btex ¹Î»ç¼Ò¼Û(õ°Ç) etex rotated 90 ,OUT); glabel.rt(btex ½ÇÁúGDP(Á¶¿ø) etex rotated -90 ,OUT); endgraph; endfig;
beginfig(6); draw begingraph(12cm,8cm); path p[]; gdata("clitig.txt",$, if scantokens $1 >=1980: augment.p0($1,$2 Sdiv 1000); fi); gdata("rgdp.txt",$, if scantokens $1 >=1980: augment.p1($1,$2 Sdiv 1000); fi); gdraw p0 withpen pencircle scaled 1.5pt; glabel.lrt(btex ¹Î»ç¼Ò¼Û etex, 13); for u=auto.y: otick.lft(format("%g",u Smul 1000),u); endfor; setcoords(linear,linear); gdraw p1 ; glabel.ulft(btex GDP etex, 15); for u=auto.y: otick.rt(format("%g",u Smul 1000),u); endfor; for u=auto.x: otick.bot(format("%f",u),u); endfor; glabel.bot(btex ¿¬µµ etex, OUT); glabel.lft(btex ¹Î»ç¼Ò¼Û(°Ç¼ö) etex rotated 90 ,OUT); glabel.rt(btex ½ÇÁúGDP(½Ê¾ï¿ø) etex rotated -90 ,OUT); endgraph; endfig;
end;