On Wed, 23 Feb 2005, Emilie Vanvyve wrote: > I'm wondering whether it is possible or not with Ferret to plot a > temperature field using CONTOUR and where the line color is changing > according to the temperature value. A bit like a FILL with a palette, > but without filling, or a bit like associating a color palette to the > lines that CONTOUR draws. Hi Emilie, I think it may not be possible to do this within the existing contour command (but of course would be delighted to be proved wrong.) The difficulties are twofold 1) contour lines are generated using some code that makes the x,y coords of the points on a contour line hard to get at. 2) the contours are rendered as lines with the inherent limits of 6 colors and three thicknesses. The only way I can imagine achieving what you want would be to use the shade command. Here is an imperfect demo of what I have in mind***. A GIF of the result is attached. I may not have thought out the discretization perfectly and a palette defined by levels may be preferable, but I hope you get the idea. A problem with this approach is that with a coarser dataset you may have to regrid (linearly) to a much finer mesh to get the pixels to look more like a line, and if taken to extremes this can lead to large memory requirements and slowness of execution. Good luck, Mick *** Void where prohibited. Your mileage may vary. Other fine print ... !----------- color contour lines ------------ use etopo5 ! a nice dense dataset region/x=100:160/y=40s:10s let roses=rose[i=@sbx:5,j=@sbx:5] ! ... smoothed a bit ! suppose we want to color the 100m,200m,...,600m contours shade/nolab/lev=(100,600,100) 0*roses ! blank chart with colorbar contour/o/nolab/lev=(0,1000,100) roses ! draw regular contours as check let rosei=100*int((roses+100)/100) ! discretize with 100m increments ... let edges=if(rosei[x=@ddc,y=@ddc] ne 0)then rosei ! ... & find steps shade/o/nolab/lev=(100,600,100) edges !----------------- end of demo -------------
Attachment:
Emilie.gif
Description: Emilie.gif