[Thread Prev][Thread Next][Index]

Re: vertical alignment of labels



Hi Andrew,
We don't have any really slick solution, and will look into what
it would take to have a vertical-alignment option for the LABEL
command.  I agree it gets messy, particularly if the label is at an
angle.  But for the simpler cases here's something that works fine:

If the positioning is in inches (/NOUSER) then adjusting by 1/2 of the
character height will give a centered label.  But if as in the previous
question to the users list the positioning is in world coordinates then we
need to know vertical adjustment in those units. That can be computed
from the units/inch ratio,
    (($PPL$YMAX1)-($PPL$YMIN1))/($PPL$YLEN)

here's an example - and it works within a viewport as well.

yes? GO ptest
yes? LABEL 0,0,-1,0,0.2,default vertical position
yes? LET vpinch = (($PPL$YMAX1)-($PPL$YMIN1))/($PPL$YLEN)
yes? LET ypos = -1* 0.5* 0.2* vpinch
yes? LABEL 0, `ypos`, 1, 0, 0.2, centered vertically
Ansley Manke

Andrew Wittenberg wrote:

Hello,

For a future version of Ferret, I'd like to put in a request for a
"vertical alignment" option for the LABEL command, with options (-1,0,1)
as for horizontal alignment.

I looked at the FAQ and found an unanswered question regarding this:

http://ferret.wrc.noaa.gov/Ferret/Mail_Archives/fu_99/tmp/msg00316.html

Although it's possible to calculate an appropriate vertical shift using
the dimensions of the plot and the viewport, this is tricky.  The shift
depends not only on the label size and angle, but also on the relation
between the plot coordinates and the physical (page) coordinates.

Have any of you All-Star Ferreteers come up with a kludge to do this?
Suppose one wanted to put a label inside a little box, which is rotated at
some angle.  What's the general solution to this problem?  (With a
vertical aligment option it would be easy.)

Thank you!

Andrew

----------------------------------------------------------------------
Andrew Wittenberg          Program in Atmospheric and Oceanic Sciences
andyw@splash.princeton.edu                        Princeton University
----------------------------------------------------------------------

--
Ansley Manke  Pacific Marine Environmental Laboratory  Seattle WA  (206)526-6246
 
[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement