t=0:0.1:2*%pi;
a=`gca`_();a.data_bounds=[t(1) -1.8;t($) 1.8];
a.margins(4)=0.2;
`plot2d`_(t,[`cos`_(t'),`cos`_(2*t'),`cos`_(3*t')],[1,2 3]);
e=`gce`_();
e.children(1).thickness=3;
e.children(2).line_style=4;
hl=captions(e.children,['cos(t)';'cos(2*t)';'cos(3*t)']);
hl=captions(e.children,['cos(t)';'cos(2*t)';'cos(3*t)'],'in_upper_right');
hl.legend_location='in_upper_right'
hl.fill_mode='on';