[Thread Prev][Thread Next][Index]

Re: [ferret_users] Working with pattern files? Stippling?

Thanks for this clarification and reply Ansley - managed to get both of your methods to work and produce what I wanted...

...to a point. Probably an exceedingly simple question, but how do I adapt the "go polymark" version to a plot where I've changed the x and y limits of the graph? E.g. 

fill/hlimits=-180:180:50/vlimits=-90:90:20 my_var 
go polymark poly/pal=black/over xsequence(lon), xsequence(lat), xsequence(my_mask), circle, 0.2

results in the polygons being drawn off the bottom right of the map, when I use 

let lon = x[gx=my_var] + 0*y[gy=my_var]
let lat = 0*x[gx=my_var] + y[gy=my_var]

(The above definitions of lon and lat work fine for "plot/vs")

Also, one further question: is there a reason why the tiny_squares pattern produced different results in the hardcopy versus the screen (see attachments in my previous email). If I understand from your email, the pattern files should work fine in the standard interactive mode....



On Feb 3, 2009, at 11:12 AM, Ansley Manke wrote:

Hi all,
The patterns are a built-in feature of the underlying graphics package xgks, which Ferret uses for most of its graphics. They're unfortunately not something the user can create more of.  If you look at what's in the pattern files, you'll see that they contain only the name of the pattern; for instance,

% cat $FER_DIR/ppl/fish_scale.pat

The pattern capability works in default Ferret interactive mode and in batch metafile mode, and in interactive mode you can do a FRAME/FILE=filename.gif which captures the screen output in a gif file.  The patterns are not available in gif mode or in the batch mode started with a postscript filename, because that mode actually calls a separate underlying graphics package, the GD library.  So, patterns work in these modes:
> ferret
  (where you get hardcopy by setting a metafile, or executing a FRAME/file=name.gif command)

> ferret -batch my_metafile.plt

> ferret -batch
(with hardcopy by setting a metafile)
but not with these:
> ferret -gif

> ferret -batch my_psfile.ps
One way to get this effect is by overlaying a set of points plotted with PLOT/VS/OVER or with polygons. These look good when done as metafiles, or when produced in gif mode:
  ! Define a mask for a region that we will fill in with points
yes? use coads_climatology
yes? let mask1 = if sst gt 25 then 1
yes? let mask = if mask1  le 30 then 1

  ! points at all the coordinate locations; these could be defined differently for
  ! more or fewer dots, see the end
yes? let lon = x[gx=sst] + 0*y[gy=sst]
yes? let lat = 0*x[gx=sst] + y[gy=sst]

yes? set win/siz=1.5
yes? shade/L=1 sst

yes? plot/vs/over/L=1/sym=dot  mask* lon, mask*lat
yes? frame/file=dots.gif

   ! Or use polygons:

yes? shade/L=1 sst
yes? go polymark poly/pal=black/over  xsequence(lon), xsequence(lat), xsequence(mask[L=1]), circle, 0.2
yes? frame/file=circles.gif

To make fewer dots:

yes? let nx = `sst,return=isize`
yes? let ny = `sst,return=jsize`
yes? let lon = x[gx=sst,i=1:`nx`:2] + 0*y[gy=sst,j=1:`ny`:2]
yes? let lat = 0*x[gx=sst,i=1:`nx`:2] + y[gy=sst,j=1:`ny`:2]

yes? let mask1 = if sst[i=1:`nx`:2,j=1:`ny`:2] gt 25 then 1

Paul Young wrote:
Hi all,

I'm trying to produce a difference plot where I highlight areas of significant difference - sort of like this plot from the recent IPCC report:

I've managed to get something similar using a "shade/over/pattern=" command, but none of the patterns has a stippling effect, or lets me edit them in Illustrator. Has anyone succeeded with anything like this in ferret before? EIse, is it possible to write my own pattern file to get the stippling? 

Thanks for any help,


Paul Young
Chemistry & Climate Processes
Chemical Sciences Division
325 Broadway R/CSD8
CO 80305

Paul Young

Chemistry and Climate Processes
Chemical Sciences Division
NOAA Earth System Research Laboratory
325 Broadway R/CSD8
Boulder CO 80305-3328

Tel:   +1 303-497-4711
Fax:   +1 303-497-5686

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement