PWRIT(3NCARG)

โœจ PWRIT โ€” bestie, it draws text โœจ

okay so this is PWRIT, straight out of the NCAR GRAPHICS manuals (the 3NCARG section, iykyk), and it does exactly one thing: it draws a text string at a position you pick, in your user coordinate system. you tell it how big, how rotated, and how centered. that's the whole vibe. ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

PWRIT โ€” draws a specified text string at a specified position in the user coordinate system. the call has arguments specifying the size, orientation, and centering of the string. that's it, that's the girl. ๐ŸŽ€


๐Ÿ’€ STATUS ๐Ÿ’€

okay so real talk. PWRIT is an earlier version of the routine WTSTR, except back in the day you had to tell it how many characters were in your text string as an argument. and now? both WTSTR and PWRIT are considered obsolete. not deprecated-cute. obsolete. ๐Ÿ˜ญ

PWRIT keeps existing purely for compatibility with early NCAR Graphics codes. so if you're writing new code, bestie, please โ€” we are begging โ€” use the more general text writing routines of the Plotchar utility instead:

  • PLCHLQ
  • PLCHMQ
  • PLCHHQ

those are the main characters now. PWRIT is the older sister who still shows up to the party. ๐Ÿซถ


โœจ SYNOPSIS โœจ

CALL PWRIT (PX,PY,CH,NC,IS,IO,IC)

๐Ÿ‘‘ DESCRIPTION ๐Ÿ‘‘

okay so here's every single argument, no skips, no cuts, periodt:

  • PX โ€” an input expression of type REAL. it defines the X user coordinate where the text string is gonna be drawn. ๐Ÿ“
  • PY โ€” an input expression of type REAL. it defines the Y user coordinate where the text string is gonna be drawn. ๐Ÿ“
  • CH โ€” an input constant or variable of type CHARACTER. this is literally the text string that gets drawn. the whole point. ๐Ÿ’–
  • NC โ€” an input expression of type INTEGER. it specifies the number of characters in the 'CH' text string. yes, you have to count them yourself. it's giving old school. ๐Ÿงฎ
  • IS โ€” an input expression of type INTEGER. it specifies the character width in plotter address units (PAUs). ๐Ÿ“
  • IO โ€” an input expression of type INTEGER. it specifies the rotation angle of the text string. IO is measured in degrees counter-clockwise from a horizontal orientation. spin that text, queen. ๐ŸŒ€
  • IC โ€” an input expression of type INTEGER. it specifies the centering option, and here's the breakdown:
    • <0 โ€” (PX,PY) will be in the vertical center of the left edge of the leftmost character in the original horizontal string.
    • =0 โ€” (PX,PY) will be in the center of the text extent rectangle. the iconique middle-of-the-road choice. ๐ŸŽฏ
    • >0 โ€” (PX,PY) will be in the vertical center of the right edge of the rightmost character in the original horizontal string.
lowkey important: a call to PWRIT causes the SPPS polyline buffer to be flushed, and it leaves the "pen" (for subsequent calls to FRSTPT, VECTOR, PLOTIF, and PLOTIT) at the location (PX,PY). so like, know where your pen ends up. โœ๏ธ

๐Ÿ”ฅ ACCESS ๐Ÿ”ฅ

to use PWRIT, you gotta load the NCAR Graphics libraries โ€” and yes, order matters:

  • ncarg
  • ncarg_gks
  • ncarg_c

preferably in that order. don't fight it, just do it. ๐Ÿ™ˆ


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

Online: gtx, gstxal, gstxp, gstxfp, gschh, gschsp, gschup, gschxp, gscr, gstxci, spps, plotchar, plchhq, plchmq, plchlq, wtstr, plotif, seti, getsi

Hardcopy: 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!! ๐Ÿ’–โœจ this was the UNIX version, dated March 1993, filed under PWRIT(3NCARG). mwah. ๐Ÿ’…๐ŸŽ€๐Ÿฆ‹