#### Helper functions for proper multiplotting #### Define before call: ## Plotting canvas (i.e. without tics, labels, titles etc.) # Examples # xpcanv= 12. #plotting canvas size x # ypcanv= 12. #plotting canvas size y # ncols =1 # number of columns # nrows =3 # number of rows # qratio=0.5 # desired aspect ratio y/x ## Overall margins (example): #lmgadd=0.07; rmgadd=0.03 #tmgadd=0.01; bmgadd=0.09 # ## Usage: # 1. Define above variables (either in or before calling this script) # 2. Call this script # 3. set terminal ... # 4. set multiplot # 5. do the plots; call mplayout_frame.gp before each plot! ## Setting the margins via "set *margin screen *mg", * = l,r,t,b # lmg=flmg(c); rmg=frmg(c); bmg=fbmg(r); rmt=ftmg(r) #### # Easy way to autoscale for font labels # ptx=0.03514598#TeX point in cm # fsize=20 # Font size in points # xfsize=1.43*ptx*fsize; yfsize=1.52*ptx*fsize # Numbers may have to be optimized manually # lmgadd=xfsize/xpcanv; rmgadd=0.001; tmgadd=0.004; bmgadd=yfsize/((xpcanv/ncols)*qratio*nrows)#autoscale ######################################################################## ## Check canvas dimensions from xpcanv and qratio if (xpcanv<=0. && ypcanv<=0.) \ print 'WARNING: Bad canvas dimensions - using defauls';\ qratio=1.;xpcanv=ncols*5.;ypcanv=nrows*5.;\ print 'xpcanv, ypcanv = ',xpcanv, ypcanv qdummy=(1.*ypcanv/nrows)/(1.*xpcanv/ncols)# multiply with 1. to convert integers to floats qlayout=real(nrows)/ncols print 'nrows,ncols,qlayout = ',nrows,ncols,qlayout if (qratio<=0.) \ qratio = qdummy;\ print 'Calculating qratio from canvas and partition';\ else if (xpcanv<=0.) \ xpcanv=ypcanv/qlayout/qratio;\ print 'Scaling xpcanv to fit';\ else if (ypcanv<=0.) \ ypcanv=xpcanv*qlayout*qratio;\ print 'Scaling ypcanv to fit';\ else if (qratio>qdummy) \ xpcanv=xpcanv*qdummy/qratio;\ print 'Rescaling xpcanv to fit';\ else if (qratio