My metapost night
September 20th, 2005 ~ Posted in: ProgrammingLast night, I spent two hours trying to get Mptopdf working, with no success, only to recall this morning that I have a binder with useful MetaPost related clippings in it, one of which applies to this situation:
tex mproof.tex myfile.mpThat processes the illustration in myfile.mp (I don’t know what it does if there’s more than one) to enable quick debugging without you having to write a wrapper tex file. mproof.tex seems to be a standard TeX file, so everyone should have it. Mptopdf was working on my computer at school, so it was even easy to preview stuff there:
mptopdf myfile.mpproduces a pdf in one step, with dimensions only large enough to fit the illustration.
Today, I spent way too much time trying to get Gnuplot and LaTeX to cooperate, since I also had to make a couple of 3d graphs, a task which MetaPost is not readily suitable for. I managed to pound something out, with suprising quality– I’ve always disliked Gnuplot’s output— with the default settings, it’s worse than even default Matlab output. In the process of pounding, I found myself thinking that Gnuplot would be a lot more powerful and easier to use if it was directly integrated into a system like Octave where truly arbitrary functions could be designed (in this particular case, I needed the unit step function). Someone should get to work on that, now.
At some point, I’m going to dedicate a section of this site to posting code showing how I did these and other programmatic illustration tasks— both for my sake, and others’. For now, I just saw Alan Kennington, who made publicly available an excellent set of metapost codes for illustrations in a topology book he’s writing, also has put up a ps file of just the illustrations. See topology.org. I referred to his code to make my graphs quickly.
Why all this work? I’m taking two engineering courses, both taught by the same professor who seems to have an unhealthy obsession with graphs— and getting satisfactory graphs is made a lot harder by the fact that the school’s license server for Mathematica and MathCad are down. I hate Matlab’s output, much more having to write a disposable program just to generate one graph, so my only recourse is more exotic avenues like MetaPost or Postscript.

This entry was posted on Tuesday, September 20th, 2005 at 10:03 pm and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply