LBLBAR(3NCARG)
β¨ 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 typeINTEGER. 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 typeREAL, 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 between0and1, 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 typeINTEGER, 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: ifNBOXis positive, the boxes get outlined after being drawn; ifNBOXis negative, they do not get outlined. sign matters, bestie, don't sleep on it πWSFB,HSFBβ input expressions of typeREALthat decide what part of each box gets color-filled or pattern-filled. each is a number between0and1. 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 typeINTEGER, 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 typeINTEGERthat says how the sub-boxes get filled, like so:- if
IFTPis zero,LBLBARfills each sub-box by calling the routineSFSGFA, over in the Softfill package. in that case, the value of the Softfill internal parameterTYdecides whether filling happens via calls to the GKS routineGFA, 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
IFTPis non-zero, the routineLBFILLgets called to do the filling. and plot twist β you can supply your own version ofLBFILL. main character energy fr fr π
- if
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 typeCHARACTERgiving 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 typeINTEGERspecifying the number of labels in the arrayLLBS. count them, bestie, be accurate π’LBABβ an input expression of typeINTEGERspecifying on which side (or sides) of the bar the labels get written. the values are:0β the bar is to be unlabeled1β labels go below a horizontal bar, or to the right of a vertical bar2β labels go above a horizontal bar, or to the left of a vertical bar3β 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 π
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
- epel 9: ncl-devel 6.6.2-59.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms