SET(3NCARG)

๐Ÿ’– SET โ€” bestie, we're mapping coordinates ๐Ÿ’–

okay so this is the NCAR Graphics manual page for SET, from the 3NCARG corner of the universe. it's the routine that defines the mapping between fractional and user coordinates: it sets the values of the SPPS internal parameters 'LS' (axis linear/log scaling) and 'MI' (axis mirror imaging), and it defines GKS normalization transformation 1. no cap, that's a lot of job for one little subroutine but she's built different. โœจ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

CALL SET(VL,VR,VB,VT,WL,WR,WB,WT,LF)

๐Ÿฆ‹ C-BINDING SYNOPSIS ๐Ÿฆ‹

#include <ncarg/ncargC.h>

void c_set(float vl, float vr, float vb, float vt, float wl, float wr,
float wb, float wt, int lf)

๐ŸŒธ DESCRIPTION ๐ŸŒธ

here's the whole cast of characters, one by one, and yes every single one of them is required ๐Ÿ’…

  • VL โ€” an input expression of type REAL. she defines the left margin of the viewport in fractional coordinates.
  • VR โ€” an input expression of type REAL. the right margin of the viewport, in fractional coordinates.
  • VB โ€” an input expression of type REAL. bottom margin of the viewport, fractional coordinates.
  • VT โ€” an input expression of type REAL. top margin of the viewport, fractional coordinates.
  • WL โ€” an input expression of type REAL. left margin of the window, in user coordinates.
  • WR โ€” an input expression of type REAL. right margin of the window, in user coordinates.
  • WB โ€” an input expression of type REAL. bottom margin of the window, in user coordinates.
  • WT โ€” an input expression of type REAL. top margin of the window, in user coordinates.
  • LF โ€” an input expression of type INTEGER. this one defines the linear/log nature of the mapping, and it goes like this:
    1. linear X, linear Y
    2. linear X, log Y
    3. log X, linear Y
    4. log X, log Y

so like, LF is literally the vibe check for your axes. pick a number, any number (well, 1 through 4). ๐Ÿ”ฅ

๐Ÿ’œ C-BINDING DESCRIPTION ๐Ÿ’œ

good news bestie: the C-binding argument descriptions are the same as the FORTRAN argument descriptions. copy-paste energy, but make it official. ๐Ÿซถ


โœจ USAGE โœจ

okay this is the part where she gets interesting. when you're setting the limits of the viewport and the window, the left margin can have a user coordinate value that is larger than the user coordinate value at the right margin. yes really. that means the X axis scale will run from a maximum value at the left to a minimum value at the right. ๐Ÿคฏ

likewise, the bottom value can exceed the top value, meaning that the Y axis can run from a maximum at the bottom to a minimum at the top. this reversal of the axes is referred to as "mirror imaging". and it represents a substantial functional enhancement over what is provided in GKS. that's literally why NCAR Graphics SET calls using fractional and user coordinates are in general preferred over GKS calls to GSVP and GSWN using normalized device coordinates and world coordinates. slay. ๐Ÿ‘‘


๐ŸŒˆ EXAMPLES ๐ŸŒˆ

use the ncargex command to see the following relevant examples: fcoord1, fcoord2, splogy, sprevx. here's the tea on each of them:

  • sprevx shows the use of routine SET for an X axis scaling reversal.
  • splogy shows the use of routine SET for logarithmic scaling of the Y axis.
  • fcoord1 shows the mapping from GKS world coordinates to GKS normalized device coordinates.
  • fcoord2 shows the mapping from NCAR Graphics user coordinates to GKS normalized device coordinates.

โญ ACCESS โญ

to use SET or c_set, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c โ€” preferably in that order. don't be chaotic about it, the order matters. ๐Ÿ™ˆ


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

Online: gsvp, gswn, getset, getusv, setusv, spps, spps_params, ncarg_cbind

Hardcopy: NCAR Graphics Contouring and Mapping Tutorial; NCAR Graphics Fundamentals, UNIX Version; User's Guide for NCAR GKS-0A Graphics;


Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.


and that's the whole page, bestie โ€” written on a UNIX system way back in March 1993, and this lil doc lives under SET(3NCARG) forever. iconic behavior from 1993 honestly. mwah. ๐Ÿ’–โœจ