summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/asymptote/examples/legend.asy
blob: 09a31868ae49ae83c19b601bcc38c8bd434a5789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import graph; 
size(8cm,6cm,IgnoreAspect); 
 
typedef real realfcn(real); 
realfcn F(real p) { 
  return new real(real x) {return sin(p*x);}; 
}; 
 
for(int i=1; i < 5; ++i)
  draw(graph(F(i*pi),0,1),Pen(i),
       "$\sin("+(i == 1 ? "" : (string) i)+"\pi x)$"); 
xaxis("$x$",BottomTop,LeftTicks); 
yaxis("$y$",LeftRight,RightTicks(trailingzero)); 
 
attach(legend(2),(point(S).x,truepoint(S).y),10S,UnFill);