function dofigure(&p,figname)