2

I'm trying to compile the Asymptote script fig0090.asy from

http://www.piprime.fr/files/asymptote/graph3/index.html

by running asy fig0090.asy in the command line but I get the error

/usr/local/texlive/2015/texmf-dist/asymptote/plain_Label.asy: 670.23: reading array of length 2 with out-of-bounds index 2

I'm using Ubuntu 14.04 LTS 64 bit and my TexLive 2015 distribution is up to date.

Contents of fig0090.asy:

size(12cm,0,false);
import graph3;
import contour;
import palette;

texpreamble("\usepackage{icomma}");

real f(pair z) {return z.x*z.y*exp(-z.x);}

currentprojection=orthographic(-2.5,-5,1);

draw(surface(f,(0,0),(5,10),20,Spline),palegray,bp+rgb(0.2,0.5,0.7));

scale(true);

xaxis3(Label("$x$",MidPoint),OutTicks());
yaxis3(Label("$y$",MidPoint),OutTicks(Step=2));
zaxis3(Label("$z=xye^{-x}$",Relative(1),align=2E),Bounds(Min,Max),OutTicks);

real[] datumz={0.5,1,1.5,2,2.5,3,3.5};

Label[] L=sequence(new Label(int i) {
    return YZ()*(Label(format("$z=%g$",datumz[i]),
                       align=2currentprojection.vector()-1.5Z,Relative(1)));
  },datumz.length);

pen fontsize=bp+fontsize(10);
draw(L,lift(f,contour(f,(0,0),(5,10),datumz)),
     palette(datumz,Gradient(fontsize+red,fontsize+black)));

1 Answer 1

3

I think you need to upgrade your postscript to 9.15 or later. See the discussion here. http://sourceforge.net/p/asymptote/discussion/409349/thread/c5f124db/

2
  • Installing the latest release, namely Ghostscript 9.16, indeed did the job!
    – Adriaan
    Aug 26, 2015 at 12:09
  • asy -epsdriver=ps2write test.asy
    – Say OL
    Dec 1, 2020 at 16:32

You must log in to answer this question.

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