Drawing multiple plots

Multiple plots

\documentclass[border=10pt]{standalone}
\usepackage{asymptote}
\begin{document}
\begin{asy}[inline=true]
settings.tex="pdflatex";
import graph; import math; import palette;
size(12cm);
import fontsize;defaultpen(fontsize(8pt));
real xmin=-3.6, xmax=5;
real ymax=1.6, ymin=-ymax;
real dxmin=0, dxmax=0.1;
real dymin=0.1, dymax=dymin;
xaxis("$x$",xmin-dxmin,xmax+dxmax,RightTicks(Step=1,step=0.2,OmitTick(0,2.2)),above=true);
yaxis("$y$",ymin-dymin,ymax+dymax,LeftTicks (Step=1,step=0.2,OmitTick(0,1.4)),above=true);

real[] n={-3, -2, -1, 0, 1, 2, 3};
pen[] p=Gradient(n.length, blue,red);

for(int i=0;i<n.length;++i){
  pair f(real y){return (y^4-y^2+n[i], y);}
  draw(graph(f,ymin,ymax), p[i]+0.7bp);
  label("$\scriptstyle{n="+string(n[i])+"}$",f(1.15), p[i],UnFill);
}

clip(box((xmin-dxmin,ymin-dymin),(xmax+dxmax,ymax+dymax)));
label("$y^4-y^2=x-n$",point(dir(80)),plain.N);
\end{asy}
\end{document}

Source: TeX.SE

Author: g.kov (License)