Want more features on Pastebin? Sign Up, it's FREE!
Guest

Minimal example for mpgraph - 2

By: a guest on Sep 2nd, 2012  |  syntax: None  |  size: 0.76 KB  |  views: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. \usemodule[graph]
  2.  
  3. \usetypescriptfile[type-auto1]
  4. \usetypescript[auto1]
  5. \setupbodyfont[auto1,ss,12pt]
  6.  
  7. \startMPinitializations
  8. input sarith;
  9. \stopMPinitializations
  10.  
  11. \starttext
  12.  
  13. \startMPcode
  14.   draw begingraph(12cm,6cm);
  15.     glabel.lft(btex Eje Y etex, OUT);
  16.     glabel.bot(btex Eje X etex, OUT);
  17.     path p;
  18.     gdata("data.d",
  19.         m,
  20.         augment.p (0,m1);
  21.         augment.p (m2,m1);
  22.         augment p (m2,m1 Sadd .5);
  23.         augment p (0,m1 Sadd .5);
  24.         gfill p--cycle withcolor .8white;
  25.         glabel.rt(m2, m2, m1 Sadd .25);
  26.         glabel.lft(m3, 0, m1 Sadd .25);
  27.     );
  28.   autogrid(grid.bot,) withcolor .85white;
  29.   gfill p--cycle withcolor .95green;
  30.   frame withcolor white;
  31.   endgraph;
  32. \stopMPcode
  33. What the font!
  34. \stoptext
clone this paste RAW Paste Data