#### Test plotting script for cubehelix.gp reset load 'parcubehelix.gp' load 'cubehelix.gp' #### Write rgb file #### set print 'cubehelix.rgb' i=0;imax=255 nrlo=0;nrhi=0 nglo=0;nghi=0 nblo=0;nbhi=0 nlo =0;nhi =0 ndegrade=0 absdefect=0. mindefect=1.e30; maxdefect=0. mindefred=1.e30; maxdefred=0. mindefgrn=1.e30; maxdefgrn=0. mindefblu=1.e30; maxdefblu=0. xatmin=0. xatmax=0. xatabs=0. gray_last=-1.; gray_beforefalling=-1.; worstgraydrop=0. ## Header print '#computer-generated cubehelix palette' print '#phi_start, rotations= ',phi_start,rotations print '#sathue, gamma = ',sathue,gamma_gry print '#gamma_rot, power_amp= ',gamma_rot,power_amp print '#wr, wg, wb = ',wr,wg,wb print '#flgdistort = ',flgdistort if (flgdistort>0) \ print '#kr, kg, kb = ',kr,kg,kb;\ print '#or, og, ob = ',or,og,ob;\ else \ print '#(no stretch & shift)'; \ print '#' ## load 'printcubehelix.gp' if (flgdistort<=0) print '#';print '#' nlo=nrlo+nglo+nblo nhi=nrhi+nghi+nbhi set print #print 'Red : nlo,nhi = ',nrlo,nrhi #print 'Green: nlo,nhi = ',nglo,nghi #print 'Blue : nlo,nhi = ',nblo,nbhi #print 'Total: nlo,nhi = ',nlo,nhi #if (nhi>0) print 'min. gray defect = ',sprintf("%+.2f%c at x=%.4f",100*mindefect,37,xatmin) #if (nlo>1) print 'max. gray defect = ',sprintf("%+.2f%c at x=%.4f",100*maxdefect,37,xatmax) #### Control plot #### set format x "%g";set format y "%g" set term push set term postscript eps color size 15.cm,10.cm font "Helvetica,24" set output 'cubehelix.eps' lws=2.0 set style line 1 lt 1 lw 1.0*lws lc rgb '#ff0000' set style line 2 lt 1 lw 1.0*lws lc rgb '#00aa00' set style line 3 lt 1 lw 1.0*lws lc rgb '#0000ff' set style line 4 lt 1 lw 1.0*lws lc rgb '#000000' set style line 5 lt 3 lw 1.0*lws lc rgb '#000000' dx=0.;dy=0.02 set xrange [-dx:1.+dx];set xtics 0.1; set mxtics 2 set yrange [-dy:1.+dy];set ytics 0.2; set mytics 2 set xlabel 'Palette Level' set ylabel 'Intensity' set key left fnul(x)=0.;fone(x)=1. #### Intensity plot #### ## plot functions directly plot fred(x) t 'red' w l ls 1, fgrn(x) t 'green' w l ls 2, fblu(x) t 'blue' w l ls 3, fgry(x) t 'gray' w l ls 4,\ fnul(x) w l ls 5, fone(x) w l ls 5 ## plot from rgb rile (should be identical) #plot 'cubehelix.rgb' using ($1/imax):2 t 'red' w l ls 1,\ 'cubehelix.rgb' using ($1/imax):3 t 'green' w l ls 2,\ 'cubehelix.rgb' using ($1/imax):4 t 'blue' w l ls 3,\ 'cubehelix.rgb' using ($1/imax):(wr*$2+wg*$3+wb*$4) t 'gray' w l ls 4,\ fnul(x) w l ls 5, fone(x) w l ls 5 #### unset output set term pop