LBLBAR(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

✨ LBLBAR ✨ (from the NCAR Graphics manual, section 3NCARG, bestie πŸ’–)

okay so real quick β€” this whole page is about LBLBAR, and it lives in the NCAR Graphics manual, section 3NCARG. she draws label bars. she's iconic. let's get into it 🫢

🌈 NAME 🌈

LBLBAR β€” Draws a complete label bar. that's it, that's the whole job, and she does it flawlessly πŸ’…

✨ SYNOPSIS ✨

CALL LBLBAR (IHOV, XLEB, XREB, YBEB, YTEB, NBOX, WSFB,
+ HSFB, LFIN, IFTP, LLBS, NLBS, LBAB)

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

#include <ncarg/ncargC.h>

void c_lblbar (int ihov, float xleb, float xreb,
float ybeb, float yteb, int nbox, float wsfb,
float hsfb, int *lfin, int iftp, char *llbs[],
int nlbs, int lbab)

πŸ’– DESCRIPTION πŸ’–

  • IHOV β€” an input expression of type INTEGER. it's zero if the bar is oriented horizontally, and non-zero if the bar is oriented vertically. pick your vibe bestie ✨
  • XLEB, XREB, YBEB, YTEB β€” input expressions of type REAL, and together they carve out a rectangular area in the plotter frame where the entire bar β€” labels and all, no exceptions β€” has to fit. each one is a real number between 0 and 1, inclusive. so: XLEB = left edge position, XREB = right edge position, YBEB = bottom edge position, YTEB = top edge position. and like, a horizontal bar should probably be wider than it is high, and a vertical bar should probably be higher than it is wide. just saying. proportions matter, it's giving basic geometry πŸŽ€
  • NBOX β€” an input expression of type INTEGER, and it can be positive or negative, no judgement. its absolute value is the number of rectangular pieces (let's call them boxes, because that's literally what they are) the bar gets divided into. every box is the same size, periodt. a horizontal bar gets split by vertical lines, a vertical bar gets split by horizontal lines. the boxes in a horizontal bar are ordered left to right, and in a vertical bar bottom to top. that ordering is what decides the order you hand over fill indices and labels. and here's the tea: if NBOX is positive, the boxes get outlined after being drawn; if NBOX is negative, they do not get outlined. sign matters, bestie, don't sleep on it πŸ’€
  • WSFB, HSFB β€” input expressions of type REAL that decide what part of each box gets color-filled or pattern-filled. each is a number between 0 and 1. they give the horizontal and vertical dimensions of the filled sub-box, as fractions of the horizontal and vertical dimensions of the whole box. the exact position of each sub-box inside its box gets figured out for you, depending on how you chose to have the bar labeled. so like, you don't gotta do that math, she's got you 🫢
  • LFIN β€” an input array of type INTEGER, holding a list of indices, one for each box in the bar. each index says how the filling of its box should happen. these can be color indices or some other kind of indices β€” depends on the value of the next argument, IFTP.
  • IFTP β€” an input expression of type INTEGER that says how the sub-boxes get filled, like so:
    • if IFTP is zero, LBLBAR fills each sub-box by calling the routine SFSGFA, over in the Softfill package. in that case, the value of the Softfill internal parameter TY decides whether filling happens via calls to the GKS routine GFA, or by drawing closely-spaced colored lines (which simulates solid fill), or by drawing lines that form patterns of different apparent densities. so many choices, all valid πŸ’…
    • if IFTP is non-zero, the routine LBFILL gets called to do the filling. and plot twist β€” you can supply your own version of LBFILL. main character energy fr fr πŸ‘‘

before the boxes get filled, the current polyline color and width get set as specified by the values of the internal parameters 'CFL' and 'WFL', respectively. so if lines are used to do the fill, and the method you picked doesn't otherwise set polyline color and width, then 'CFL' and 'WFL' will take effect. iykyk ✨

after filling is done, the filled sub-boxes may be outlined using the color and line width specified by the Labelbar internal parameters `CBL' and `WBL'. (and like, as mentioned above, this only happens if the argument NBOX is positive β€” it's suppressed if NBOX is negative. so watch that sign 🚨)

  • LLBS β€” an input array of type CHARACTER giving a list of labels for the bar. the number of labels can be:
    • the number of boxes less one, in which case the labels are associated with the divisions between the boxes, or
    • the number of boxes, in which case the labels are associated with the boxes themselves, or
    • the number of boxes plus one, in which case the first label is associated with the beginning of the bar, the last label with the end of the bar, and the ones in between with the divisions between the boxes.

the labels get drawn by calls to the Plotchar routine PLCHHQ. they're drawn in the color specified by the Labelbar internal parameter 'CLB', using the polyline width specified by the Labelbar internal parameter 'WLB'. cute AND configurable 🌸

  • NLBS β€” an input expression of type INTEGER specifying the number of labels in the array LLBS. count them, bestie, be accurate πŸ”’
  • LBAB β€” an input expression of type INTEGER specifying on which side (or sides) of the bar the labels get written. the values are:
    • 0 β†’ the bar is to be unlabeled
    • 1 β†’ labels go below a horizontal bar, or to the right of a vertical bar
    • 2 β†’ labels go above a horizontal bar, or to the left of a vertical bar
    • 3 β†’ labels get repeated on both sides of the bar

the labels get scaled so they don't overlap each other or run outside the area where the label bar is supposed to lie β€” except maybe for labels at the ends of the bar. so, like, mostly well-behaved, ends are the wild card πŸ™ˆ

πŸ’œ C-BINDING DESCRIPTION πŸ’œ

the C-binding argument descriptions are the same as the FORTRAN argument descriptions. no new lore, same facts, different syntax, we love consistency ✨

πŸŽ€ EXAMPLES πŸŽ€

use the ncarg command to see the following relevant examples: colcon, cpex05, cpex07, cpex08, elblba, tconpa, and tlblba. go look at them, they're right there, they ate πŸ”₯

🌟 ACCESS 🌟

to use LBLBAR or c_lblbar, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order. order matters, don't be chaotic about it πŸ’…

πŸ¦‹ MESSAGES πŸ¦‹

see the labelbar man page for a description of all Labelbar error messages and/or informational messages. if something's yelling at you, that's where the answers live 🫢

⭐ SEE ALSO ⭐

Online: labelbar, labelbar_params, lbfill, lbgeti, lbgetr, lbseti, lbsetr, ncarg_cbind

Hardcopy: NCAR Graphics Fundamentals, UNIX Version

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, no cap πŸ’– this one's from the UNIX manual, dated March 1993, and it's LBLBAR(3NCARG) β€” go draw a label bar, you're gonna slay πŸŒˆβœ¨πŸŽ€

πŸ“¦ where this page comes from