Is it possible to (easily) draw dash-dotted curves in MetaPost, i.e. curves that alternate between a dash and a dot?

For either dashed or dotted curves, I use the draw command and end it with dashed evenly or dashed withdots, respectively.

Does MetaPost include a similar option for dash-dotted curves?

2 Answers 2


The definition of withdots is

dashpattern(off 2.5 on 0 off 2.5)

while evenly is

dashpattern(on 3 off 3)

Thus something like

draw dashpattern(on 3 off 3 on 0 off 3) dashed evenly;
picture p;
draw fullcircle scaled 1cm xscaled 3 dashed p;

taken from figure 32 in the Metapost manual will alternate dashes and dots.

enter image description here

  • @Gassa Yes, thanks for fixing.
    – egreg
    Commented May 1, 2023 at 17:43

not that it matters, but for the record the definitions of withdots (widthdots is a typo) and evenly are reversed in the above. actual definitions from plain.mp:

evenly=dashpattern(on 3 off 3); % `dashed evenly'
withdots=dashpattern(off 2.5 on 0 off 2.5); % `dashed withdots'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .