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

1
vote
1answer
29 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
55 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 ...
3
votes
0answers
340 views

Why no GUI for Metafont? [closed]

Why has no-one ever created a graphical user interface for Metafont? One can easily imagine a system that would allow interactive adjustment of the font parameters, with near-real-time display of ...
4
votes
3answers
337 views

Underline in metauml

\documentclass{article} \usepackage[shellescape]{gmp} \begin{document} \begin{figure} \begin{mpost}[use] input metauml; Class.A("A") ("-instance: A") ("-A()", "+instance(): A"); ...
2
votes
1answer
138 views

Omitting visibility marker in MetaUML

Is there a way to omit the visibility (lock symbol) marker in MetaUML Class objects? If I just refrain to use one I get a protected marker as a default. A short example (note: the LaTeX builder has ...
4
votes
2answers
137 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 ...
21
votes
5answers
553 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
742 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 ...
3
votes
1answer
567 views

Where is mp.exe in MikTeX 2.9?

I am a a retired software engineer and a newbie on this site. Please execuse me for the naiveness in my question. I am using Windows, XP and Vista. Other OS's are not affordable to me for now. I used ...
37
votes
3answers
2k views

What is Metapost/Metafont and how can I get started using it?

Inspired by Why Metapost discrimination?, I'd like to come to know Metapost far better than I do now. All I really know is that Metapost is a language for describing graphics, and Metafont is used ...
10
votes
1answer
171 views

Is this a bug in the pfb file or a bug in metapost's “glyph”? [closed]

I've only recently started playing with metapost's "glyph". I've discovered (MWE below) an anomaly with the paths in serifs for the cm font set from these experiments. Starting point: it seems that ...
11
votes
4answers
860 views

Plot the cusp catastrophe surface

I'm trying to draw (plot) the Cusp catastrophe surface into latex using any software logic. I am completely stuck because I'm definitely not a mathematician. The surface has the potential: V(x) = ...
7
votes
2answers
339 views

btex and etex in luamplib labels

I've been experimenting with METAPOST and in particular with luamplib. I found that I couldn't have tex typeset labels with the btex/etex construct as apparently is possible with straight up METAPOST. ...
5
votes
2answers
283 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 ...
27
votes
1answer
6k views

Package for typesetting Feynman diagrams (efficiency of `feynmp` and `tikz`)

Is there any good package for typesetting lots of Feynman diagrams? My question arise because Feynmp: Circle with three vertices lead me take a look at the documentation for the feynmf/feynmp ...
88
votes
3answers
6k views

Fundamental differences : PSTricks, TikZ/PGF and others

OK, since this is a pretty vague and subjective question. I need to set up some borders around the discussion that I intend to benefit from. But before anything, I certainly do NOT want to excite the ...
6
votes
3answers
3k views

MetaPost pictures in PDFLaTeX

To include MetaPost pictures in a latex file compiled by pdflatex I usually do something like \usepackage[pdftex]{graphicx} ... \includegraphics{filename-without-mps} but this requires all metapost ...
11
votes
1answer
191 views

Union of Paths in MetaPost

I'd like to compute the union of a collection of outlines in MetaPost. I'm aware of the buildcycle macro (in combination with cutbefore and cutafter). However, that macro is not very useful because I ...
9
votes
3answers
271 views

Why two intersected paths can't buildcycle in MetaPost?

Suppose that I have two path: beginfig(0) u:=10pt; vardef randomcirc(expr O, r, w) = save p,i; pair p; numeric i; p=O+right*r; p for i=1 upto 9: .. (p rotatedaround(O, ...
5
votes
1answer
112 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} ...
52
votes
8answers
3k views

How to automatically draw tree diagram of prime factorization with LaTeX?

I want to have a simple interface to automatically draw tree diagrams of prime factorization. For example, by invoking the following code, \PrimeTree{36} \PrimeTree{90} \PrimeTree{112} ...
6
votes
2answers
151 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} ...
2
votes
1answer
262 views

Im trying to set up a graph but keep gettin error “isolated expression”

beginfig(1); numeric u; path xaxis,yaxis; Scale: 1=u u=0.5in; yaxis= (0,-4.1u)--(0,4.2u); xaxis= (-4.1u,0)--(4.2u,0); pickup pencircle scaled 1pt; drawarrow xaxis; drawarrow yaxis; pickup pencircle ...
4
votes
0answers
94 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 ...
11
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
74 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; ...
20
votes
3answers
817 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: ...
9
votes
2answers
686 views

OpenType fonts for Metapost Labels

Is it possible to use OpenType fonts in MetaPost labels? I use MiKTeX 2.9. I hoped something like mpost --tex=dvilualatex <myfile>.mp might work, but no luck. Suggestions? I tried this, but ...
2
votes
0answers
117 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 ...
42
votes
12answers
4k views

Drawing a Reuleaux Triangle

A Reuleaux triangle is a shape of constant width sort of like a rounded equilateral triangle. (Reuleaux triangle - Wikipedia, the free encyclopedia) It can be formed by the intersection of three ...
4
votes
3answers
702 views

Metapost label based on variable value

I want to label a scale based on a variable value and I wrote a metapost code like this. $ := 1; for i = -.3cm step .6cm until 3.6cm: label.bot(str$,(i,-3.7cm)); $ := incr($); endfor; It ...
104
votes
9answers
11k views

Simulating hand-drawn lines

I am working on a project that will have some vector graphics, perhaps using TikZ (or a similar package). All of the graphics consists of lines, in shades of gray. However, the lines from TikZ appear ...
4
votes
2answers
84 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 ...
4
votes
1answer
116 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
114 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 ...
9
votes
8answers
949 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 ...
15
votes
4answers
2k views

A good METAPOST alternative for plotting 3d surfaces

I find METAPOST to be a wonderful software to create 2d charts and figures. Can you name me a few good alternatives to METAPOST for drawing 3d surfaces? The crucial feature I'm looking for is the ...
0
votes
0answers
86 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 ...
3
votes
2answers
81 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
655 views

Getting “The memory dump file could not be found” when trying to compile mpost file

I am using texmaker with the following mp example: filenametemplate "%j%c.mps"; beginfig(1); z1=(0,0); z2=(10mm,10mm); drawarrow(z1--z2); label.ulft(btex $A$ etex, .5[z1,z2]); endfig; I keep ...
4
votes
1answer
88 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
66 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 ...
3
votes
3answers
185 views

How can I fill a complex path with Metapost/Metafun?

Is there any way to produce exactly following PS and SVG code with Metapost/Metafun? Unfortunately, unfill won't work for me, as there is a background in the resulting page. And this example is ...
0
votes
1answer
52 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
158 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
515 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 ...
29
votes
2answers
3k views

Milestone graphic in TikZ

This question led to a new project for a TikZ based solution: timeline The author of the original artwork has posted his METAPOST based library: blueprint How could I implement a ...
1
vote
1answer
95 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: ...
5
votes
1answer
69 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
3answers
893 views

Drawing system architecture in Latex

I want to draw a system architecture as in the picture below Can you help me?