MetaPost uses a language based on that of Metafont to produce precise technical illustrations. Its output is either scalable PostScript or SVG or bitmaps PNG, rather than the bitmaps Metafont creates. This tag is compatible with {diagrams}.

learn more… | top users | synonyms

2
votes
1answer
46 views

On flexibility/power of metapost to create graphs

I have the following pgfplots graph embedded in a TeX document that I am happy with. Recently, reading up on metapost, I'd like to try to recreate the graph with it. \begin{figure}[ht] \centering ...
5
votes
1answer
156 views

How to draw dots equally spaced along a path?

Is it possible to draw dots with Metapost so that each dot is separated from its first neighbour by the same distance along an arbitrary path? I do not want their real distance to be regular! Rather, ...
4
votes
4answers
194 views

With which package will I create, in the shortest code, two points with horizontal error bars with overlap region dashed?

Pgfplots? Metapost? Tikz? As I can't make it right now with any of them, I have to choose one of them to study. Which of them? Which has shortest code? Which has best image quality? I don't mind ...
4
votes
1answer
38 views

What's “logarifm” in Metapost and why I get the error “Undefined control sequence”?

I'm trying the following Metapost sample: http://www.ursoswald.ch/metapost/tutorial/TeXLabels.html With the following code: \documentclass{article} \usepackage{luamplib} \everymplib{input ...
1
vote
3answers
119 views

real MetaPost space

In MetaPost I label something with: Label(1)(percent, ", 269 GiB") (inwards, 0) withcolor (1, 1, 0) ; Unfortionately the space after the comma and the space between 269 and GiB is represented by a ...
3
votes
1answer
74 views

How do I use piechartmp to make pie charts with Metapost?

This is my MetaPost input file: prologues := 3 ; outputformat := "%j-%c.eps" ; input piechartmp; beginfig(1); SetupColors((0.7, 0.7), this, this) ; SetupPercent(this, "%") ; Segment(64, ...
2
votes
1answer
35 views

ps2pdf crahes on MetaPost generated .eps figure

I generated with MetaPost the example in "LaTeX Graphics Companion", 2nd ed., p. 174, above. The eps is generated. The header: %!PS %%BoundingBox: -123 -92 64 43 %%HiResBoundingBox: -122.84787 ...
1
vote
1answer
101 views

question concerning MetaPost usage

Dear Frank Mittelbach, I bought your book "The LaTeX Graphics Companion", second edition. I have a question concerning a MetaPost example in that book, p. 174 above. I have put this in a file called ...
3
votes
0answers
58 views

Save Feynman diagram files in a subfolder

Suppose one has a simple Feynman diagram, such as the following MWE (which has to be run with -shell-escape, I guess this is to allow compilation to "escape the shell" to run metapost). ...
9
votes
1answer
163 views

draw salts and ions with education purposes

I want to draw some schematic representations of salts for educational purposes. The figure shows a example which can be generated with the metapost code below. I would like to improve the draws in ...
0
votes
0answers
120 views

Draw a simplicial complex

In a paper I'm writing using TeX I would like to include some pictures of Euclidean simplicial complexes. How can I draw an Euclidean simplicial complex embedded in R^3? That is, given a set of ...
4
votes
0answers
44 views

How to round the corner in a cycle metapost path, when the first/last point is a corner? [closed]

It is useful to have most simple coordinates, to define picture primitives, such as the "fullcircle" expression. When I define a 1x1 rectangle prologues:=3; outputtemplate:="%j-%c.png"; ...
4
votes
1answer
54 views

MetaPost & gmp package. How to use diacritical signs inside mpost?

First of all, I've read this question: Proper use of the emp package. But... How to use diacritical signs inside mpost? Like ā, ä, ā, ä, ǟ, ḑ, ē, ī... The project was created on overleaf.com. ...
1
vote
1answer
45 views

Can I query the current value of randomseed in Metapost?

Metapost allows you to set a seed for the random number generator, so that you can get a predictable sequence of numbers from uniformdeviate and normaldeviate. I can set it like this: randomseed := ...
0
votes
1answer
111 views

Draw a transparent box (over a grid)

How can I draw a transparent box in Metafont? I would like to have something like the legend in this graph: https://de.wikipedia.org/wiki/Datei:Articlecount_topten_wikipedia.svg. You could say I want ...
4
votes
2answers
253 views

Fonts in math expressions in Metapost

I try to create a Metapost figure that contains math fonts, like: beginfig(1); label.urt(btex $\mathfrak{b}$ etex,(100,0)); label(btex $\mathcal{X}_{\eta}$ etex,(-15,55)); endfig; end ...
23
votes
5answers
627 views

Recreate the sphere in TeX.SX logo

I'm trying to recreate this But looking in this Meta question the only code provided doesn't give that output %!TEX TS-program = xelatex \documentclass{minimal} \usepackage{pst-solides3d} ...
19
votes
8answers
980 views

Compute and draw a convex hull

How can I use TikZ (+ LuaTeX), PSTricks, MetaPost, Asymptote, etc. to draw the convex hull of a set of points specified in no particular order? Here's an example where the convex hull was computed by ...
5
votes
2answers
348 views

Drawing Kano Model

I was wondering if someone can indicate me the easiest way to sketch the following picture. I started using the axis environment from pgfplots package as you can see from my code below, but then I got ...
5
votes
1answer
153 views

Why doesn't metapost know about the path in my feynmp code?

I'm trying to use FeynMP to draw a Feynman diagram exactly like this but with a photon line inside the circle. This code works perfectly to create the diagram above: \fmfleft{i} \fmfright{o} ...
6
votes
2answers
201 views

How does the angle key from arrows.meta TikZ library work?

The title says it all. How does angle=<angle>:<first dimen> <second dimen> works. More exactly, what do the first length and the second length mean? \usetikzlibrary{arrows.meta} ...
4
votes
0answers
152 views

Code to preview metapost output?

Does anyone out there have a cute way of previewing images generated by MetaPost? As far as I can tell, after making the .mp file there is a bit a process for viewing the file. I figure there aught to ...
12
votes
5answers
2k views

How one can draw 405 degree angle in learning material?

I would like to know how one can draw teaching material of trigonometry in LaTeX? Namely, I was looking how to draw 405 degree angle i.e. unit circle, a line segment to the circumference and a spiral ...
3
votes
2answers
87 views

Problem with `plot` option for `gdraw` in MetaPost

I have the following problem with MetaPost and graph package for it. So I have a source: input graph; beginfig(1) draw begingraph(16cm, 2cm); gdraw "a.txt" plot "+"; endgraph; ...
2
votes
0answers
157 views

Yannis's yinit font (gothic initials) and metapost

I am trying to produce EPS standalone files for all Gothic Initials from the Yannis'metafont sources recently reissued by Karl Berry for TL2014 (texmf-dist/fonts/source/public/gothic/). I run ...
4
votes
1answer
128 views

Metapost error related with ConTeXt

I try to reuse this code from fpast (Generating Random arrows in tikz) in context but I found a error message associated with the freelabel() function. If I try to add the labels with label() function ...
3
votes
1answer
121 views

vectors with marks for forces representation

In the first approach to teaching forces are presented to students diagrams with various forces and asked to them to group the forces according to their orientation, direction and magnitude. I often ...
10
votes
8answers
2k views

Drawing minimal xy axis

can anybody help me to draw this minimal example of an xy axis? I couldn't find anything similar on the forum. The axis should be black but the grid behind it a shade o gray, dashed. It would be ...
0
votes
0answers
100 views

How include MetaPost from ConTeXt to LaTeX?

I found ConTeXt document and I get file with MetaPost like this : % language=uk % author : Hans Hagen, PRAGMA ADE, NL % license : Creative Commons, Attribution-NonCommercial-ShareAlike 3.0 ...
4
votes
2answers
87 views

Bad 'numberprecision' has been ignored

I just read that it's possible to run METAPOST with a binary numbersystem (mpost -numbersystem binary) and that it's possible to specify the number of bits by assigning a value to the variable ...
4
votes
1answer
89 views

parametric overlay in context

I am trying to make something like excel databars in context TABLE enviroment. I have created overlay, that should draw the databar, but I can't figure out, how to pass data into that overlay. Is it ...
2
votes
0answers
79 views

Semantics of Intersections in MetaPost/MetaFont

I may have discovered a bug in MetaPost and MetaFont but before I report it, I'd like to make sure it really is a bug. From an intuitive point of view I'd expect that if two paths have an ...
0
votes
1answer
89 views

Metapost won't compile from the command line

I just downloaded MiKTeX and started to learn Metapost. I created the text file example.mp and went to cmd with command "mpost example" and it says: "I can't open file 'example' " I know that it ...
3
votes
1answer
194 views

Milestone graphic in TikZ with rectangles

Within the forum I found this nicely designed milestone / timeline graphic: Milestone graphic in TikZ Regarding this graphic I would like to make two adaptations: How can I adjust the code in order ...
16
votes
4answers
666 views

How to draw random simple closed smooth curves but with the same perimeter?

I want to draw some random simple smooth closed curves. Each smooth curve must have the same perimeter but different area. See the following figure to illustrate what I meant clearly. Each smooth ...
1
vote
1answer
112 views

metapost annotation

Metapost is a powerful tool for drawing, but not sure if it's more easier than tikz for annotation. Is it possible to draw this annotation graph with metapost? tikz code: ...
4
votes
1answer
76 views

Incomplete trace of a function

Why the curve is not drawn to the point x1 ? \starttext \startMPcode xmin := -1; xmax := 5; ymax :=4 ;ymin:=-4; u := 1cm; pickup pencircle scaled 1pt ; a:=2-sqrt(3); b:=2+sqrt(3); def ...
5
votes
1answer
50 views

Anchor macro for paths

I am trying to build a macro to assign anchors for a given path. This is what I have: beginfig(1); def anchors(expr p) = pair p.n, p.e, p.s, p.w; p.n := .5(ulcorner p + urcorner p); p.e := ...
0
votes
0answers
43 views

Metapost - ! I can't find file `mpIdZQs7.aux'

I try to compile a simple metapost graphic with a TeX label (for subscript). The problem is that when I try to run 'mpost --tex=latex file.mp' I get an error. Looking through log files it seems that ...
2
votes
2answers
510 views

Hypersphere inscribed within hypercube

Let's consider a hypersphere of radius r inscribed in a hypercube with sides of length 2r. Than take the ratio of the volume of the hypersphere of radius r to the hypercube with side length l = 2r. We ...
4
votes
2answers
129 views

How to import metapost to .tex properly and how to do it without importing

I have read several questions related to metapost and latex here on TEX SE, but I still cannot solve my own problem. So it is a very basic problem. I am trying to include a metapost graphic in my ...
8
votes
1answer
502 views

Concentric Cylinders with tikz

I am trying to draw two concentric cylinders with tikz to show the change in volume with respect to radius, while the height remains fixed. The left ilustration below is the first drawing, where the ...
5
votes
1answer
106 views

How to handle dependencies in METAPOST

I am working on the Blueprint package, a graphical toolkit for project managers and system designers, and time has come to tidy up the library design. There is several modules in the library and I ...
2
votes
0answers
33 views

Different results of running metapost on two systems

I have a problem with a metapost and LaTeX file. I use LaTeX and metapost on two different macs, both with the same version of OS X (10.9.5) and both with, as far as I can tell the same installation ...
22
votes
3answers
909 views

Automatically generate graphics which shows light diffusion on a rough surface

I just want to make an image like this (using tikz or pstricks) of light reflexion and diffusion: What I am interested in is, how this can be done (semi)-automatically via tikz or pstricks: ...
4
votes
0answers
113 views

Processing metafont source with metapost

I have a file say test.mp that contains: outputtemplate := "%j-%c.eps"; mode=localfont; mag=100.375; input cmr10.mf; When I run mpost as follow: mpost&mfplain test.mp Some of the glyphs ...
2
votes
1answer
61 views

Metapost “odd” operator fails with negative value?

Has anyone else noticed that in Metapost the odd operator appears to fail with negative numbers? Here's my test program (which works with both Metafont and Metapost). for i=-2 upto 2: show(i); ...
3
votes
1answer
252 views

Proper use of the emp package

I've used metapost for generating figures for my latex documents for some time, but I've always managed them as separate documents, and included the resulting graphics into the latex document using ...
4
votes
1answer
241 views

how to efficiently code in metapost?

I am trying to get better at metapost, but the error messages are pretty cryptic (if there are at all) and it always takes a big effort go compile an mp file. Up 'best' program for writing and ...
2
votes
0answers
407 views

MetaPost to PDF in Texmaker (miktex)

I am trying to make the MPost command in Texmaker work. I am using the Texmaker in windows 7 with miktex. So far I used the example document below. When using the windows console I was able to use ...