[Thread Prev][Thread Next][Index]

Re: Coordinate systems...



Hi Gary,

I think we can fix most of this with a combination of some new external function,
which we could write to support coordinate transformations, and some further
understanding of how things work.  I would like to ask you to illustrate the
situations that you find most difficult and to propose the external functions that
you would find useful (offline probably to be preferred to minimize traffic).

Regarding your specific example
    "label 50% 50% 0 0 0.5 @AS10"
what you need is (example)

     PLOT/VS/LINE/I=1:314/hlim=-300:300/vlim=-300:300 i*cos(i/20),i*sin(i/20)

     !show sym

     label/nouser `($PPL$XLEN)/2`,`($PPL$YLEN)/2`,0,0,0.5 @as10

     pause

     label/nouser `($PPL$XLEN)/2`,`(($PPL$YLEN)-0.5)/2`,0,0,0.5 @as10

This uses the symbols that store the axis lengths and the /nouser qualifier to
indicate the use of the page measurement coordinate system, rater than the
numerical axis units of the plot.  Note that since the fonts are *text* by default
it positions the baseline of the text string.  By subtracting 0.5 of the symbol
height you can center them.

Two aside suggestions

  1. for point-and-click positioning try "yes? label ,,,0,0.5 @as10"
     and then position the mouse over the plot. A menu will let you specify
     justification and then click to position the text.  The position you clicked
     will be confirmed on the screen and stored in a symbol for batch use later.
     (The "arrow" and "line" menu options allow you to annotate plots.)
  2. yes? plot/vs/overlay/nolab/symbol=2/size=.2 0,0
     can put any symbol from the PM font (plot marks) directly on a specified
     point  -- (0,0) (see yes? GO show_symbols  and  GO show_88_syms)

As to defining window sizes in pixels, there is a script called set_pixel_size.jnl
to do this.  Ferret is not image-oriented, it uses scalable, continuous graphics
primitives, so the pixel size of a window is a device dependent afterthought.
Admittedly, it is a very common need, though.

    - steve

============

Gary Strand wrote:

> Am I the only one who gets frustrated by the way various coordinate systems are
> defined and used in FERRET?
>
> For example, plot space is defined in inches, viewports are defined in frac-
> tions, and various other things can be defined in terms of inches or in the
> units of the underlying data. Toss in viewports, and/or changing the window
> size and the aspect ratio, and it can become very challenging. More than once
> I've had to resort to trial and error to get things in the right place, since
> (at least to me) I'm not sure which units work where on the plot I'm making.
>
> I've gone through a similar exercise with GrADS (the 'vpage' and 'parea' com-
> mands could drive one crazy) but GrADS did have a couple nice transformation
> functions one could use to make life a wee bit easier - one could go from
> data coordinates to page coordinates and vice versa.
>
> I guess what I'm asking for is a unified system of coordinate specification,
> or a way one could specify which coordinate system one would like, that could
> take into account the various manipulations of window size and aspect ratio
> such that (say) a label specified like
>
> "label 50% 50% 0 0 0.5 @AS10"
>
> puts a "10" exactly smack-dab in the center.
>
> Also, to make window sizing easier, would it be possible to define window sizes
> directly, in terms of (say) pixels, so that one could say:
>
> set window/pixels/size=640x480
>
> and get a window exactly 640 pixels by 480?
>
> Thanks for listening to my rant(s).
>
> --
> /\        Gary Strand (303) 497-1336                                NCAR ML262A
>   \_][    www.cgd.ucar.edu/ccr/strandwg                      1850 Table Mesa Dr
>       \___strandwg@ucar.edu                       Boulder, Colorado, USA  80305



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement