[Thread Prev][Thread Next][Index]

Re: [ferret_users] irregular font sizes for legend



Dear Ansley, Billy, and Ferret users,

On Fri, Aug 26, 2022 at 4:20 AM Ansley Manke <a.c.manke@xxxxxxxxx> wrote:

The PPL LIST LABELS command shows that Moveable labels 1, 2, and 3 are the "logo", the lines that show the PyFerret version, date and time, and they are very small.  Apparently that sizing isn't reset when subsequent PPL LABS commands use those label numbers, and PPL LABSET doesn't do that either. So, do a "cancel mode logo" first.


Thank you for the further investigation!

So, the issue is this:
1) The PLOT command sets up automatic labels (logo, dataset name, regions, etc.).
2) The "legend" script overwrites some of those labels (using PPL's label command, which is PPL LABS).
3) But the labels retain their sizes set at step (1).

Below I paste a script that demonstrates this point.

One mystery is that somehow the PPL LABSET command doesn't change the size of the movable labels.

Workarounds include

a) cancel mode logo

b) Use the PPL HLABS command to set the size:
  . . . . .
  repeat/range=1:6/name=labnum (ppl HLABS,`labnum`,0.12)
  go legend 1 . . .
  . . . . . .
  go legend 6
  . . . .

c) Modify the "legend" script to start the label number from 20 or something, in order not to overwrite the automatic labels, so that legend 1 would be label 21, etc.

d) Modify the "legend" script to set the label size, perhaps from an additional argument (parameter).

Because the "legend" script doesn't seem to be used to get publication-quality figures, we wouldn't have to bother much.

Best regards,

Ryo

!-- demonstrate how the PPL label command ("PPL LABS")
!  overwrites the automatic labels.
set data levitus_climatology
set region/x=180
plot temp[y=0] ! no legend
pause
plot/set temp[y=0]
  go legend 1 "movable label 1" ! highjacks the first logo line
ppl plot
pause
plot/set temp[y=0]
  go legend 6 "movable label 6" ! highjacks the dataset name
ppl plot




 

The old PPL calls that are used by the legend script really should be updated with more modern and easy-to-use commands.

Ansley


On 8/24/2022 4:56 PM, William Kessler - NOAA Federal wrote:
I use my own handmade legend scripts so I don't experience these errors, but if they are PPLUS moveable labels you should be able to set them with:

PLOT ...
PPL LABSET,,,,label_height   ! arguments are main_label_height, x_label_height, y_label_height, moveable_label_height
go legend ...
PPL PLOT

Or possibly the LABSET command should go after the legend commands? It shouldn't matter unless the legend.go script is somehow resetting them.

Billy

On Wed, Aug 24, 2022 at 4:47 PM Ansley Manke <a.c.manke@xxxxxxxxx> wrote:

Ryo,

How strange.  I tested with classic-Ferret and it does this too, so it's not a pyferret thing and not dependent on the system.  After your script runs, if you do this:

yes? ppl list labels

it lists the location and size of the labels.  Removing the clutter from that output, and making the sizes bold in the listing, you can see that the sizes are small then larger then somewhat smaller again as the script is called over and over.  These are PPLUS "moveable" labels so their size should be 0.12


          XPOS       YPOS     HGT   ROT   UNITS
 LAB 1  6.000E-01  5.750E+00 0.060    0  SYSTEM  y=0
 LAB 2  6.000E-01  5.550E+00 0.060    0  SYSTEM  y=5
 LAB 3  6.000E-01  5.350E+00 0.060    0  SYSTEM  y=10
 LAB 4  6.000E-01  5.150E+00 0.120    0  SYSTEM  y=15
 LAB 5  6.000E-01  4.950E+00 0.120    0  SYSTEM  y=20
 LAB 6  6.000E-01  4.750E+00 0.102    0  SYSTEM  y=25

I'll see if I can see what's going on, or maybe update that script.

Ansley

On 8/24/2022 9:25 AM, Ryo Furue wrote:
Dear Ferret users,

I've found that the font size changes after the 3rd element of the legend as in the image below. This is the first time for me to use the legend script and I know very little about it. Have you seen this problem before?  Below I paste the script that generated the image.

macOS 12.5.1
PyFerret v7.63 (optimized)
  Darwin 19.6.0 - 10/13/20

Best regards,

Ryo
-----
set data levitus_climatology
set region/x=180
plot/vlimits=0:2000/set\
  temp[y=0], temp[y=5], temp[y=10],\
  temp[y=15], temp[y=20], temp[y=25]
  go legend 1 "y=0"
  go legend 2 "y=5"
  go legend 3 "y=10"
  go legend 4 "y=15"
  go legend 5 "y=20"
  go legend 6 "y=25"
ppl plot
frame/file=tmp.png
tmp.png

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

Privacy Policy | Disclaimer | Accessibility Statement