Asymptote: resizing the picture (including pen widths and font sizes)

1.4k Views Asked by At

I have created a picture in Asymptote. Now I want to resize it, so that the resulting image is bigger. The problem is that if I call size() or unitsize(), the sizes of TeX labels and line widths (which are hard-coded) are left untouched. I'd like to resize these along with the image, so that the lines look the same width (and the labels look the same size) in proportion to the size of the whole picture. Is it possible to do that from Asymptote?

2

There are 2 best solutions below

0
jamadagni On

I am not a highly experienced MetaPost/Asymptote user and I am also only now learning the two. But I was reading the Asymptote FAQ and I hope http://asymptote.sourceforge.net/FAQ/section8.html#manualscaling will answer your question.

0
MattyV On

Well... This is a very old question, but let's give it a more ready-to-use answer. First draw it to one picture, which will use deferred drawing/automatic scaling as normal. Then, draw that picture to another one, with additional scaling to taste.

real originalSize = 3inch;
real scaledSize = 12inch;

size(originalSize);
// ... draw your picture

picture original = currentpicture;
currentpicture = new picture;
add(scale(scaledSize / originalSize) * original.fit())