Dashline(3NCARG)

✨ NAME ✨

Dashline β€” a whole lil friend group of line-drawing routines that can generate every dashed line pattern you could ever want (solid counts, bestie, solid is a pattern too πŸ’…), slap labels on your lines, smooth them out, and even suppress crowding when your lines are all up in each other's business.

There are four different versions of Dashline, and yes they all have main character energy:

  • "normal"
  • "quick"
  • "smooth"
  • "super"

Wanna know how to summon each one? Scroll to the ACCESS section, babe. It's all there. 🫢

This whole thing lives in the NCAR Graphics manual, for the record.


πŸŽ€ SYNOPSIS πŸŽ€

  • DASHDB β€” Defines a dash pattern, no labels. Clean. Simple. Iconic.
  • DASHDC β€” Defines a dash pattern with labels. Heads up tho: if you call DASHDC while you're running the "quick" version of Dashline, you get an error exit. Not a vibe.
  • FRSTD β€” Defines the first point of a sequence of points that a curve is gonna get drawn through.
  • VECTD β€” Defines the second and all the following points of that same sequence.
  • LASTD β€” Wraps up the sequence (so like, one FRSTD followed by one or more VECTD calls) and actually draws the curve.
  • LINED β€” Draws a straight line segment between two points. No frills, no drama.
  • CURVED β€” Draws a curve through a sequence of points.
  • RESET β€” The "super" version of RESET zeroes out the internal integer array it uses to detect crowded lines. The other versions of RESET literally do nothing. They're just there. Chilling. πŸ™ˆ

🌈 C-BINDING SYNOPSIS 🌈

#include <ncarg/ncargC.h>
  • c_dashdb
  • c_dashdc
  • c_frstd
  • c_vectd
  • c_lastd
  • c_lined
  • c_curved
  • c_reset

πŸ’… USAGE πŸ’…

The Dashline utility lets you draw various kinds of lines. In all four versions (quick, normal, smooth, and super), you can specify an arbitrary dash pattern for your lines β€” and yes, a solid line counts as a pattern. In all but the quick version, you can also add interspersed labels to the lines, which is perfect for stuff like naming lines in an XY plot or assigning contour levels to contour lines. And in the smooth and super versions, lines can be smoothed using splines under tension. Fancy.

⚠️ Warning, bestie, for real: you gotta be careful with the smoothing option. Letting the smoothing go too hard can have serious side effects β€” think XY curves with multiple valued loops, and contours crossing over other contours. It's giving chaos. Do not recommend.

The super version additionally allows for the culling of crowded lines. For that culling process to actually work properly, the routine RESET must be called at the beginning of each picture. When you're using the other versions of Dashline, you can totally leave those RESET calls in there β€” they just do nothing, so it's harmless. πŸ¦‹


πŸ‘‘ ACCESS πŸ‘‘

To use the normal version of the Dashline utility, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order, okurrr.

Other optional libraries that create the quick, smooth, and super versions of Dashline get automatically linked in by the ncargf77 command. So you don't even have to think about it. Slay. πŸ’…

If you genuinely need to know the names of these libraries for a particular version of Dashline, run an "ncargf77" command with the appropriate option and a dummy input file, then examine the resulting command line that gets echoed and executed. It'll tell you everything, no cap.

So, to run a code called mycode.f that has one or more calls to Dashline entries, issue one of these commands:

NORMAL β€” Command:

ncargf77 mycode.f

The lines will be drawn as unsmoothed dashed or solid lines. DASHDC may be called to define a dash pattern with labels. ✨

QUICK β€” Command:

ncargf77 -quick mycode.f

The lines will be drawn as unsmoothed dashed or solid lines. The dash pattern may not include labels. If DASHDC is called, an error exit will result β€” you have to use DASHDB instead. Periodt.

SMOOTH β€” Command:

ncargf77 -smooth mycode.f

The lines will be drawn as dashed or solid lines, smoothed using splines under tension. DASHDC may be called to define a dash pattern with labels. 🧚

SUPER β€” Command:

ncargf77 -super mycode.f

The lines will be drawn as dashed or solid lines, smoothed using splines under tension. DASHDC may be called to define a dash pattern with labels. Crowded lines will be thinned β€” and for that to work properly, you must remember to call RESET at the beginning of each picture. Don't forget. I'm begging. πŸ™


πŸ’€ MESSAGES πŸ’€

When error conditions get detected, the support routine SETER is called in such a way that it writes a message to the standard error file (as defined by I1MACH(4)) and then terminates execution. So yeah, it's over.

The possible error messages are as follows:

  • CFVLD -- VECTD CALL OCCURS BEFORE A CALL TO FRSTD You must call FRSTD before the first call to VECTD. Order matters, bestie.
  • DASHDB -- BLOCKDATA DASHBD APPARENTLY NOT LOADED CORRECTLY If you've used the ncargf77 command options as discussed in the ACCESS Section, then go see your system administrator. That one's not on you. 😭
  • DASHDC -- BLOCKDATA DASHBD APPARENTLY NOT LOADED CORRECTLY You called DASHDC while using the "quick" version of Dashline. That is not allowed. Sorry not sorry.
  • FDVDLD -- VECTD CALL OCCURS BEFORE A CALL TO FRSTD You must call FRSTD before the first call to VECTD. Same energy as CFVLD, different name. The universe is testing you.

πŸ¦‹ SEE ALSO πŸ¦‹

Online: dashline_params, curved, dashdb, dashdc, frstd, lastd, lined, reset, vectd, 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.


okay that's the whole page, we ate and left no crumbs πŸ’– this one came from the UNIX corner of the NCAR Graphics manual, dated March 1993 β€” yes she's vintage, she's timeless, she's Dashline(3NCARG) and she's still serving. mwah. πŸŽ€βœ¨