Comprehensive TeX Archive Network

Direc­tory graphics/metapost/contrib/macros/matlab

matlab.mp ------- Metapost data plotting in matlab style

Yang Yang yangyang@juggler.ucsd.edu

March 3 2005

Matlab has powerful data plotting ability, but one annoying problem
prevents it from being perfect: when you increase the linewidth, the
dotted line size stays the same, so the plotted line no longer looks
like a dotted line.

another problem is matlab bug: it oftern cuts away some curves and

plus, matlab is expensive. on the other hand, the free gnuplot also
doesn't produce very satisfactory visual effects.

I got accustomed to matlab's easy interface. so I want to integerate
the powerful graphic function of Metapost and the easy interface of
Matlab. so I wrote this script matlab.mp. this is based on graph.mp, I
just collected the data into 2-D arrays, and remembered the line
styles, so it's easy to plot out legends.

all kinds of line color, width, style (dotted/dashed, etc), and
markers. you can easily expand this by modifying the code.

easy interface. very similar to matlab

full power of latex in caption/legends, by using the latexmp package.

Down­load the con­tents of this pack­age in one zip archive (51.0k).

meta­post-mat­lab – data plot­ting in Mat­lab style

Mat­lab has pow­er­ful data plot­ting abil­ity, but one an­noy­ing prob­lem pre­vents it from be­ing per­fect: when you in­crease the linewidth, the dot­ted line size stays the same, so the plot­ted line no longer looks like a dot­ted line.

Another prob­lem is Mat­lab's bugs: it of­ten cuts away some curves and cap­tions. And, of course, Mat­lab is ex­pen­sive. On the other hand, the free Gnu­plot doesn't pro­duce very sat­is­fac­tory vi­sual ef­fects ei­ther.

The au­thor got ac­cus­tomed to Mat­lab's easy in­ter­face, and wanted to in­te­gerate the pow­er­ful graphic func­tions of with the in­ter­face of Mat­lab. The out­come was mat­lab.mp. It is based on graph.mp (part of the dis­tri­bu­tion). The pack­age col­lects data into 2D ar­rays, and re­mem­bers the line styles, so it's easy to plot out leg­ends. The pack­age fea­tures:

– All kinds of line colour, width, style (dot­ted/dashed, etc), and mark­ers (the code may eas­ily be ex­panded);
– Easy in­ter­face, very sim­i­lar to Mat­lab;
– The full power of is avail­able in cap­tions and leg­ends, by us­ing the la­texmp pack­age.

Li­cense The Project Public Li­cense
Main­tainer Yang Yang
Topics plot data
See also metapost
Guest Book Sitemap Contact Contact Author