[metapost] Including an image into a metapost figure

Mojca Miklavec mojca.miklavec.lists at gmail.com
Thu Dec 21 01:18:08 CET 2006

On 12/21/06, j.romildo at gmail.com wrote:
> Hello.
> I need to draw a figure in metapost and this figure will be constructed
> with images in an extern format (png). How can I "draw" an extern image
> on my metpost figure?
> Romildo

I doubt that you can do that in plain metapost (maybe I'm wrong), but
you can use metafun.

For example:

\startMPpage % or \startMPcode
    externalfigure "filename.png" xyscaled (300,200);
    % normal metapost code goes here
\stopMPpage % or \stopMPcode

which has to be compiled with "texexec filename". See metafun manual
for more details:


More information about the metapost mailing list