set pm3d depthorder nohidden3d set palette defined (0 "dark-green", 1 "white") set parametric set urange [0:2*pi] set vrange [-pi:pi] set samples 48 set isosamples 48,24 set view 75,15,1,1 set size 0.9,1 set style line 100 lw 0.2 lc rgb "navy" unset key set ticslevel 0 x1(u,v)=cos(u)+.5*cos(u)*cos(v) y1(u,v)=sin(u)+.5*sin(u)*cos(v) z1(u,v)=.5*sin(v) x2(u,v)=1+cos(u)+.5*cos(u)*cos(v) y2(u,v)=.5*sin(v) z2(u,v)=sin(u)+.5*sin(u)*cos(v) set term pngcairo crop set output "tori.png" set multiplot layout 2,1 set size 1,1 set origin 0,0 splot x1(u,v), y1(u,v), z1(u,v) w pm3d,\ x2(u,v), y2(u,v), z2(u,v) w pm3d set size 1,1 set origin 0,0 set hidden3d unset tics unset border unset colorbox splot x1(u,v), y1(u,v), z1(u,v) lw 0.5 lc rgb "navy",\ x2(u,v), y2(u,v), z2(u,v) lw 0.5 lc rgb "dark-red" unset multiplot ! convert -transparent white -geometry 50% tori.png tori_s.png |