Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

With a valid figure, I would like to always produce the mirror figure. To clarify my thought, I'm looking for some tricks to do something like:

beginfig(1);
  ...
endfig;

beginfig(2);
  mirror(fig1);
endfig;

Is such a thing possible ?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted
picture keep;
beginfig(1);

... Metapost code ...

keep:=currentpicture;
endfig;

beginfig(2);
z1=.5[llcorner keep,lrcorner keep];
z2=.5[ulcorner keep,urcorner keep];
currentpicture:=keep reflectedabout (z1,z2);
endfig;
end

Before shipping out the first figure, we keep it into a picture variable. The operators llcorner and so on allow access at the bounding box of a picture.

A similar trick is used in manfnt.mf to draw the mirror image of the dangerous bend symbol (see the definitions of characters 127 and 126).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.