[Thread Prev][Thread Next][Index]

Re: [ferret_users] Fill and



Hi Serena (also responding to your earlier message about contour levels).

First, contouring, while conceptually straightforward, is a hard thing to program. Figuring out where to put contour labels without obscuring other contours or overwriting other labels is again something that a human would do easily, but hard to specify in an algorithm. How many labels is "enough"? In my experience, Ferret does a better job of this than some others.

The two commands you need to control this are PPL CONSET and PPL SHAKEY; that is, you need to give your CONTOUR/SHADE/FILL command with /SET, then specify the two PPL commands, then draw the plot with PPL CONTOUR/SHADE/FILL.

PPL CONSET,hgt,nsig,narc,dashln,spacln,cay,nrng,dslab ! controls the contouring and labeling
PPL SHAKEY [0=nokey,1=key] [0=hor,1=vert] lab-size lab-inc lab-dig lab-len xlo xhi ylo yhi  ! controls the color key

These are described in the "Enhanced commands" section, Appendix C 2.2 and C 2.4
https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-c-ferret-specific-pplus-enhancements/ENHANCED-COMMANDS-DESCRIPTION#_VPID_767
(Some of CONSET can also be controlled by qualifiers to CONTOUR, or by its /LEVELS options; see CONTOUR)

With respect to occasional missing end values in the colorbar, I think this may be the result of rounding somewhere in the calculation (???). You can often work around this by tweaking the upper or lower bound by a tiny amount. E.g.,

If the original command fails:
shade/x=50w:20e/y=30s:30n/levels=(0.014,0.029,0.001) SST[l=@ave]/1000
Try:
shade/x=50w:20e/y=30s:30n/levels=(0.013999,0.029,0.001) SST[l=@ave]/1000
or:
shade/x=50w:20e/y=30s:30n/levels=(0.014,0.029001,0.001) SST[l=@ave]/1000

I don't know why these sometimes succeed when the apparently correct specification fails!

Billy

On Tue, Jun 21, 2022 at 4:52 AM Serena Illig <serena.illig.ird@xxxxxxxxx> wrote:
Dear Ferret users,

I hope this email finds you well.

I am writing regarding some contour labels. I am using PyFerret v7.63 on Linux Ubuntu (via miniconda) but I have the same issues with PyFerret v7.62 and ferret v6.71.

I noticed a problem in the number of colors associated with the FILL or SHADE commands. When I use SHADE and I increase the number of levels, there are some cases for which the last level range is not drawn and is missing in the color scale. It happens when the quantity drawn is small (for instance wind stress in N/m2). 

Here are 3 examples:
use coads_climatology.cdf
shade/x=50w:20e/y=30s:30n/levels=(14,29,1) SST[l=@ave]
  ---> 15 color levels, with levels 0(1), the colorscale is OK
shade/x=50w:20e/y=30s:30n/levels=(0.014,0.029,0.001) SST[l=@ave]/1000
 ---> 15 color levels, with levels 0(1/1000), the colorscale is missing the last level
shade/x=50w:20e/y=30s:30n/levels=(0.014,0.028,0.001) SST[l=@ave]/1000
  ---> 14 colors levels with levels 0(1/1000), the colorscale is OK
fill/x=50w:20e/y=30s:30n/levels=(0.0014,0.0029,0.0001) SST[l=@ave]/10000
  ---> 15 colors levels with levels 0(1/10000), the colorscale is missing the last level

I could not find any rules for which it happens. I thought at first that it is linked to the number of levels, but I found counter-examples (see my last example above).

Maybe this issue has already been reported?

Have a nice day,

Serena Illig

.¸. , . .·´¯`·
 ><(((º>     `·.¸.·´¯`·...¸><(((º>¸.¸. , . .·´¯`· ><(((º> .
`·.¸.·´¯`·...¸><(((º>                                                    .
                                                                                  .
  Serena ILLIG-THEVENIN       LEGOS/IRD             .
                                                                                  .
  Editorial Board Member for Scientific Reports      .
                                                                              .
                         14 Av. E. Belin                           .
                         31400 Toulouse                        .
                         FRANCE                                   .
                                                                             .
         E-mail : serena.illig.ird@xxxxxxxxx             .
         Web-site : http://sillig.free.fr                       .
         Phone : +33 5 61 33 29 26                      .
                                                                       .
                                                     <º)))><..·


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement