PLOTIF(3NCARG)

πŸ’– NAME πŸ’–

PLOTIF is a line-drawing routine, bestie, and it's described in terms of "pen moves" β€” yes like an actual pen, we're doing arts and crafts but make it FORTRAN. Most calls to PLOTIF tell you whether the "pen" should be up (not drawing, just vibing) or down (drawing, committing to the line) and then move it to a designated position in the fractional coordinate system. The polylines that come out of all this pen moving are buffered, and some calls to PLOTIF are just there to flush the SPPS polyline buffer. That's the whole job. Iconic.


✨ SYNOPSIS ✨

CALL PLOTIF (FX,FY,IP)

πŸ¦‹ C-BINDING SYNOPSIS πŸ¦‹

#include <ncarg/ncargC.h>

void c_plotif (float fx, float fy, int ip)

🌸 DESCRIPTION 🌸

  • FX β€” an input expression of type REAL, it's the X fractional coordinate of the point where the plotter pen is getting moved to. Important lore: if IP = 2, this argument is straight up ignored. It's not even invited to the party.
  • FY β€” an input expression of type REAL, the Y fractional coordinate of the point where the plotter pen is getting moved to. And same deal: if IP = 2, this argument is ignored too. Rude but true.
  • IP β€” an input expression of type INTEGER, and it's the one making all the decisions here. It determines whether the movement of the plotter pen to the point (FX,FY) happens with the pen up (IP = 0) or with the pen down (IP = 1). And if IP = 2, no pen move occurs at all β€” but the SPPS polyline buffer gets flushed. Three moods, one integer.

🌈 C-BINDING DESCRIPTION 🌈

The C-binding argument descriptions are literally the same as the FORTRAN argument descriptions. No notes, no differences, we love consistency. πŸ’…


πŸ’… USAGE πŸ’…

Okay so here's how you actually use it, bestie:

  • "CALL PLOTIF (FX,FY,0)" β€” moves the pen to a new starting position. Pen up, no drawing, just relocating. Fresh start energy.
  • "CALL PLOTIF (FX,FY,1)" β€” moves the pen to a new position, drawing a straight line segment from the previous position to the new one. Pen down, we're committing.
  • "CALL PLOTIF (0.,0.,2)" β€” flushes the SPPS polyline buffer. That's it, that's the whole move.

The size of the SPPS polyline buffer can be changed by calling the parameter-setting routine SETUSV to set the parameter 'PB'. The legal range of 'PB' is between 2 and 50. For example, to set 'PB' to 2, use:

"CALL SETUSV ('PB',2)"
NOTE! 🚨 The SPPS polyline buffer exists to increase drawing efficiency. But there are side effects, and they can occur because the polyline segments get buffered. For example, if you wanted to change the color of a line at a certain point, you'd have to remember to flush the buffer before calling GSPLCI to change the polyline color index. Do not skip this step, I am begging. And heads up β€” this applies to the changing of any polyline attribute, not just the color. So remember: flush first, then change stuff. 🫢

πŸŽ€ EXAMPLES πŸŽ€

Use the ncargex command to see the following relevant examples: arex01, cbex01, cmppos, coex03, cpexcc, epltch.

πŸ‘‘ ACCESS πŸ‘‘

To use PLOTIF or c_plotif, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order. Order matters, don't freestyle it.


⭐ SEE ALSO ⭐

  • Online: gpl, plotit, setusv, getusv, sflush, frstpt, vector, line, curve, spps, spps_params, ncarg_cbind
  • 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.


Okay bestie that's the whole page!! This one came from the NCAR GRAPHICS manual, PLOTIF(3NCARG), and the footer on the original said UNIX and March 1993 β€” so yeah, this routine is a 1993 baddie and it still ate. πŸ’…βœ¨ Go draw some lines, ily, bye!! πŸ¦‹πŸŒΈ