我希望像图片上一样在一个输出文件中包含两张图片。下面的代码将输出结果设置为两个重叠部分,我希望其中一个位于第二个旁边。
size(11cm,0);
import graph;
import graph3;
import geometry;
//colors
pen dBlue1=rgb(66/255, 81/255, 172/255);
pen dRed=rgb(237/255, 27/255, 43/255);
pen dGray=rgb(130/255, 130/255, 130/255);
defaultpen(0.7bp+dGray+ fontsize(14pt));
pen pblue=1.1bp+dBlue1; //
pen pred=1.1bp+dRed; //
real as=3bp;
picture pic1,pic2;
limits(pic1,(-2,2),(-4,4));
xaxis(pic1,Label("$x$"),Arrow(as));
yaxis(pic1,Label("$y$"),Arrow(as));
real f(real x) {return ((x)^3); };
draw(pic1,Label("$y=x^3$",position=Relative(0.9)),graph(f,-1.6,1.6),pred);
add(pic1);
real F(pair z) {
return z.x^2+z.y^2;
}
currentprojection=orthographic(3,2,1);
limits(pic2,(-2,-2,-1),(2,2,3));
xaxis3(pic2,"$x$",Arrow3);
yaxis3(pic2,"$y$",Arrow3);
zaxis3(pic2,"$z$",Arrow3);
draw(pic2,surface(F,(-1,-1),(1,1),nx=16,Spline),
lightblue+opacity(0.5),pblue);
add(shift(5.5,0)*pic2);
shipout(bbox(5mm,invisible));