[Thread Prev][Thread Next][Index]

Re: fill or shade with pattern



> 
> Dear Ferreters,
> Is it possible to fill or shade a region with a pattern instead of a 
> colour or a grayscale ?
> Thanks for helping.
> 

Hi Toni,

You might find that the 'transparency' trick in the go file fland is what you
need. Essentially, it deletes every second point (or some other pattern) to
give a speckled appearance. I've found that for the best effect you need to
interpolate your variable onto a REGULAR finer grid. How fine should be governed
by your plot appearance, not the density of data. Finer grids => finer patterns
and a better effect but take a bit longer 

Say we have some variable VAR defined in the region x=0:10:1 y=0:10:1

let var=x[x=0:10:1]+y[y=0:10:1]
!define fine axis/grid 

define axis/x=0:10:0.1 xnew
define axis/y=0:10:0.1 ynew
define grid/x=xnew/y=ynew gnew

! interpolate
let  vnew=var[g=gnew]

! A couple of masks to try

!stipple effect 
let vnew_1 = if(mod(i+j,2) eq 0) then vnew

! sparser pattern
let vnew_2 = if((mod(i+j,4) eq 0) and (mod(i,2) eq 0) ) then vnew


! vertical stripes
let vnew_3 = if(mod(i,4) eq 0) then vnew

! horizontal
let vnew_4 = if(mod(j,4) eq 0) then vnew

! diagonal bottom right to top left (i-j for opposite)
let vnew_5 = if(mod(i+j,4) eq 0) then vnew

! silly
let vnew_6 = if(randu(vnew) gt 0.7) then vnew

! You can then use the shade command with a single palette to display

shade/palette=grey vnew_1


The effect can be quite good say if you want to highlight patches where a
variable is positive on a contour plot of another variable but don't want to
interfere with the labelling or dominate the plot.

Cheers,
Russ Fiedler 


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement