[Thread Prev][Thread Next][Index]

Re: [ferret_users] VP_RT_MARGIN symbols label/nouser (corrected)



Hi Patrick
I don't think that the LABEL command is intended to be used until after a plot is drawn. It's true that when you issue the SET VIEW UR command, all of these symbols are set.

yes? set v ul
yes? sh sym
...
PPL$XLEN = "5.012"
PPL$YLEN = "3.423"
PPL$XORG = "1.200"
PPL$YORG = "1.400"
VP_WIDTH = "7.212"
VP_HEIGHT = "6.223"
VP_SCALE = "1.414"
VP_RT_MARGIN = "1"
VP_TOP_MARGIN = "1.4"
...

yes? list ($vp_rt_margin)+($ppl$xlen)+ ($ppl$xorg)
          7.212

yes? list ($vp_top_margin)+($ppl$ylen)+ ($ppl$yorg)
          6.223

which add up to VP_WIDTH and VP_HEIGHT. But it looks as if the LABEL command still needs a plot to be actually drawn before it will correctly locate the label.

! These commands put the XXX somewhere too low.
yes? set view ul
yes? label/nouser `($ppl$xlen)/2`, `($ppl$ylen)/2`, 0,0,0.2,@p2XXX

! These commands locate the label in the center of the plot area of the viewport.
! Make an invisible plot
yes? plot/color=white/nolab/noax/i=1:2 i
yes? label/nouser `($ppl$xlen)/2`, `($ppl$ylen)/2`, 0,0,0.2,@p2XXX


On 9/7/2011 6:20 AM, Brockmann Patrick wrote:
Hi all,

I would like to improve a small script that places a text in a viewport
with coodinates expressed as percentage of the size of the viewport

I should be able to do that by typing:

yes? set v UL
yes? ! place a "XXXXX" label centered at 50% of the width and 50% of the height of the current viewport yes? label/nouser `($VP_WIDTH)*0.5-($VP_RT_MARGIN)`,`($VP_HEIGHT)*0.5-($VP_TOP_MARGIN)`,0,0,0.2,"XXXXX"

Unfortunatelly symbols VP_RT_MARGIN and VP_TOP_MARGIN seems not set correctly.
For what I understand:

1) the symbol VP_RT_MARGIN is missing the floating digits
yes? set v UL
yes? say "($VP_RT_MARGIN) ($PPL$XORG)"
!-> MESSAGE/CONTINUE "1 1.200"
1 1.200

2) they should be equal to 0 when you change of viewport and when no plot has been drawn yet

3) they should be affected by the PPL ORIGIN command since I understand that they are synonyms of the ppl$xorg and ppl$yorg symbols*
*ORIGIN,XORG,YORG
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-b-pplus-guide/COMMAND-DESCRIPTION#_VPID_706 VP_RT_MARGIN SET VIEWPORT width of right margin(see ppl$xorg for left margin) VP_TOP_MARGIN SET VIEWPORT width of top margin(see ppl$yorg for lower margin)

For now I can do what I want using:
yes? set v UL
yes? plot i[i=1:10]
yes? label/nouser `($VP_WIDTH)*0.5-($PPL$XORG)`,`($VP_HEIGHT)*0.5-($PPL$YORG)`,0,0,0.2,"XXXXX" but I must produce a plot before (to set symbols) and that is not what I necessary want.

The lines that should run correctly
("OOOOO" and "+++++" centered in upper viewport, "XXXXX" centered in LL viewport)

$ ferret
yes? set v upper
yes? label/nouser `($VP_WIDTH)*0.5-($VP_RT_MARGIN)`,`($VP_HEIGHT)*0.5-($VP_TOP_MARGIN)`,0,0,0.2,"OOOOO"
yes? set v LL
yes? plot/nolab i[i=1:10]
yes? label/nouser `($VP_WIDTH)*0.5-($VP_RT_MARGIN)`,`($VP_HEIGHT)*0.5-($VP_TOP_MARGIN)`,0,0,0.2,"XXXXX"
yes? set v upper
yes? label/nouser `($VP_WIDTH)*0.5-($VP_RT_MARGIN)`,`($VP_HEIGHT)*0.5-($VP_TOP_MARGIN)`,0,0,0.2,"+++++"

Thanks
Patrick



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

Privacy Policy | Disclaimer | Accessibility Statement