[metapost] A couple of basic questions

Reinhard Kotucha reinhard.kotucha at web.de
Fri Feb 10 23:28:56 CET 2006

>>>>> "Will" == Will Robertson <will at guerilla.net.au> writes:

  > Hello, I've finally started to look into metapost for plotting my
  > graphs, since it seems like the best options with regards to graph
  > output quality and being able to blend the graph labels with the
  > body text of whichever document the graph is placed in.

  > My first question is: has no-one created anything more advanced
  > than mpgraph? I ask not because I think mpgraph is deficient (it
  > seems really good, actually), just curious. All I've come across
  > is - gpdata.mp, which looks useful, and - matlab.mp, which gives
  > me errors, and doesn't make me too confident about using it.

  > Anyway, I'm mostly interested in 2D plots for now, and I'll leave
  > 3D plots to MATLAB for now.

All the MATLAB graphics I've seen had been quite ugly.  Recently I
used gnuplot to produce metapost code from ASCII data files produced

The metapost output had been piped into a Perl script which fixed a
few ugly things:  You certainly neither want labels in FORTRAN ("1e-5")
nor something like "0.00001", for example.

It makes sense to generate the graphics in the final size instead of
scaling them when they are loaded into the document.  You certainly
want to use the same fonts in the same size as in your LaTeX file.

This can be achieved easily by using the same preamble in the main
LaTeX document and in the verbatimtex section in metapost.

However, I've never been very happy with this approach because I had
to post-process gnuplot's output.  A new gnuplot release will probably
break my script.  And gnuplot has an annoying syntax.

Another interesting program which can read ASCII data files produced
by MATLAB is PyX.  PyX is written in Python and uses Python as a user
interface.  Hence, it is very powerful and extensible.  It produces
eps or pdf and uses TeX in the background for typesetting.

Look at http://pyx.sf.net for more information.

(Sorry for advertising PyX on the metapost list :)

BTW., there is a free program which is mostly compatible with MATLAB,
see http://octave.org 

...but certainly you already know.

Reinhard Kotucha			              Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.

More information about the metapost mailing list