reset flgverbose=1 flg3dplot=1 w=2. ; set xrange [-w:w];set yrange [-w:w] #### Generate test data file test.tmp set isosamples 201,201 # w=2.; dw=0.5; ndw=5 set xrange [-w:w]; set yrange [-w:w] unset xtics; unset ytics #set xtics dw; set mxtics ndw; set ytics dw; set mytics ndw fgauss(x,y)=exp(-0.5*(x*x+y*y))#/sqrt(2.*pi) #ff(x,y)=exp(-0.5*(x*x+y*y)) f1(x,y)=fgauss(x,y) f2(x,y)=fgauss(x**2,y**2) f3(x,y)=fgauss(sqrt(abs(x)),sqrt(abs(y))) f4(x,y)=fgauss(abs(x)**0.25,abs(y)**0.25) f5(x,y)=fgauss(x,sqrt(abs(y))) f6(x,y)=fgauss(x,1./sqrt(y*y+0.01)) set table 'test.dat' splot f3(x,y) unset table ########################### load 'parcubehelix.gp' load 'cubehelix.gp' set term push set term postscript eps color size 15.cm,13.16cm #set palette file 'RGB_palettes/nebula2.rgb' using 1:2:3:4 set size ratio -1 #### Plotting options and commands #### set lmargin screen 0.01; set rmargin screen 0.87 set bmargin screen 0.01; set tmargin screen 0.99 unset key set output 'test.eps' plot 'test.dat' using 1:2:3 notitle with image set palette function fgry(gray),fgry(gray),fgry(gray) set output 'testgray.eps' plot 'test.dat' using 1:2:3 notitle with image reset set term pop load 'plotcubehelix.gp' if (flg3dplot>0) load 'splotcubehelix.gp' #### Test colour clipping epsdefect0=1.e-03 epsdefect1=1.e-02 epsdefect2=1.e-01 epsdefect3=3.e-01 if (flgverbose>=1) \ print '*** Colour Clipping & Monotonic Slope Test ***';\ print 'Red : nlo,nhi = ',nrlo,nrhi;\ print 'Green: nlo,nhi = ',nglo,nghi;\ print 'Blue : nlo,nhi = ',nblo,nbhi;\ print 'Total: nlo,nhi = ',nlo,nhi;\ print 'Slope: ndegrade= ',ndegrade if (flgverbose>=1&&nrhi+nrlo>0) print 'red defect: ',sprintf("min. = %+6.2f%c, max. = %+6.2f%c",100*mindefred,37,100*maxdefred,37) if (flgverbose>=1&&nrhi+nrlo>0) print 'grn defect: ',sprintf("min. = %+6.2f%c, max. = %+6.2f%c",100*mindefgrn,37,100*maxdefgrn,37) if (flgverbose>=1&&nrhi+nrlo>0) print 'blu defect: ',sprintf("min. = %+6.2f%c, max. = %+6.2f%c",100*mindefblu,37,100*maxdefblu,37) if (flgverbose>=1&&nhi>0) print 'min. gray defect = ',sprintf("%+.2f%c at x = %.4f",100*mindefect,37,xatmin) if (flgverbose>=1&&nlo>0) print 'max. gray defect = ',sprintf("%+.2f%c at x = %.4f",100*maxdefect,37,xatmax) if (flgverbose>=1&&nhi+nlo>0) print 'abs. gray defect = ',sprintf(" %.2f%c at x = %.4f",100*absdefect,37,xatmax) if (flgverbose>=1&&ndegrade>0) print 'worst gray drop = ',sprintf(" %.2f%c",100*worstgraydrop,37) if (flgverbose>=1&&nlo+nhi+ndegrade==0) print '=> No gray defect -- perfect!';\ else if (flgverbose>=1&&ndegrade>0) print '=> Slope inversion -- try lower saturation';\ else if (flgverbose>=1&&absdefect Almost no gray defect -- very good!';\ else if (flgverbose>=1&&absdefect No noticable gray defect -- good!';\ else if (flgverbose>=1&&absdefect Some gray defect -- still reasonable';\ else if (flgverbose>=1&&absdefect Large gray defect -- try lower saturation';\ else if (flgverbose>=1&&absdefect>=epsdefect3) print '=> Huge gray defect -- try lower saturation' #### Show vectors if (flgverbose>=2) \ print '*** Equiluma Base Vectors ***';\ print 'u1,u2,u3 = ',sprintf("%+.6f, %+.6f, %+.6f",u1,u2,u3);\ print 'v1,v2,v3 = ',sprintf("%+.6f, %+.6f, %+.6f",v1,v2,v3) #### Test orthogonality if (flgverbose>=3) \ print '*** Check orthogonality ***';\ print ' = ',u1*v1+u2*v2+u3*v3;\ print ' = ',wr*u1+wg*u2+wb*u3;\ print ' = ',wr*v1+wg*v2+wb*v3 #### Test splot (may corrupt splot screen display) if (flgverbose<4) q print ' ' print '*** Test splot output ***' print ' ' set format x "%11.8f";set format y "%11.8f";set format z "%11.8f" if (flgverbose==4 || flgverbose==6) \ print 'Grey curve' ;\ set table ;\ splot '+' using (fgry($1)):(fgry($1)):(fgry($1)) if (flgverbose==5 || flgverbose==6) \ print 'RGB helix' ;\ set table ;\ splot '+' using (fred($1)):(fgrn($1)):(fblu($1)) set format x "%g";set format y "%g";set format z "%g" unset table