HISTGR(3NCARG)
π HISTGR β the histogram glow-up page π
NCAR GRAPHICS Β· HISTGR(3NCARG) Β· bestie, you're in the right place π«Ά
β¨ NAME β¨
HISTGR β plots a histogram with various options including specification of class values, spacing between histogram bars, shading of bars, windowing (i.e. scaling), specification of color, labels, titles, etc. Data values are partitioned into classes; histogram bars represent either number of occurrences within each class, or a Y-value associated with that class (user choice). Options are set by calls to subroutines HSTOPL, HSTOPR, HSTOPC, and HSTOPI before the call to HISTGR.
π§ UTILITY π§
This routine is part of the Histogram utility in NCAR Graphics. To see the overview man page for this utility, type:
man histogram
π SYNOPSIS π
CALL HISTGR (DAT1,NDIM,NPTS,IFLAG,CLASS,NCLASS,WRK,NWRK)
π C-BINDING SYNOPSIS π
#include <ncarg/ncargC.h>
void c_histgr (float *dat1, int ndim, int npts,
int iflag, float *class, int nclass, float *wrk, int nwrk)
π DESCRIPTION π
okay so here's every single argument, and yes we are doing all of them, no skipping π
DAT1β Two dimensional real array containing data of one of two types, either values to be collected into class intervals before plotting, or values which have already been assigned to class intervals and only need to be displayed. See argumentIFLAGfor a more complete description ofHISTGRinput data options.DAT1is dimensioned:DAT1(NDIM,2).NDIMβ The size of the first dimension ofDAT1as set in the dimension statement of the calling program.NPTSβ Number of values actually stored intoDAT1on this call.NPTSmust always be less than or equal toNDIM.IFLAGβ An integer flag which selects one of four options provided by theHISTGRutility. The options are:0β A single array of lengthNPTSis loaded into theDAT1array.HISTGRcomputesNCLASSequally sized class intervals that vary from the minimum value inDAT1to the maximum value in steps of(MAX-MIN)/NCLASS.
All values of DAT1 that fall in each class interval are separately accumulated for that interval. The final tabulations are plotted as a histogram of NCLASS bars. The bar height can be labeled with the number of points that fall within this particular class interval (bin size), or it can be given as a percentage of the number of values input, NPTS.
Note that under this option the user has no control over the range of the class intervals. They are internally determined from the range of the data. π that's just how it is, bestie.
1β This option is similar to theIFLAG = 0option except that the user can select the range of the class intervals into which the data are collected. For example, say the user wants to collect the number of occurrences of theDAT1values that fall within 5 equally spaced intervals in the value range from0.to10.The user would then inputNCLASS+1class interval end points into arrayCLASS, namely0.,2.,4.,6.,8., and10.These values need not be entered in monotonically increasing order and need not be equally spaced. π2β This option allows the user to enter and display data which has already been accumulated into class intervals, i.e., already available histograms. The data input toDAT1thus have percentage of total, or number of occurrences values. In this case the number of points inDAT1,NPTS, is equal to the number of class intervals (histogram bars),NCLASS. TheNCLASSclass interval midpoints are loaded into arrayCLASS. They do not have to be of equal width.3β This option is the same as optionIFLAG = 2except that two histograms can be displayed for comparison purposes. The first histogram is loaded intoDAT1(NPTS,1). The second histogram is loaded intoDAT1(NPTS,2). The first histogram can partially shade or obscure the second histogram by the appropriate selection of theSPACandOVERLPoptions. Note thatNPTS = NCLASSwhenIFLAG = 2or3.
CLASSβ Real array containing class values, dimensioned(NCLASS+1). This array has the followingIFLAGdependencies:IFLAG = 0βCLASSis not used. π«IFLAG = 1βNCLASS+1class interval end points are loaded into arrayCLASSin a monotonically increasing order. The intervals need not be of equal width.IFLAG = 2βNCLASSmidpoint intervals are loaded into arrayCLASS. They must be in monotonically increasing order, but need not be of equal widths. The histogram bars will however be displayed with equal widths. πIFLAG = 3β Same as forIFLAG = 2.
NCLASSβ Number of class intervals (histogram bars) specified.NCLASSmust be.GE. 1. (so like, at least one bar, pls π₯Ί)WRKβ Real scratch array, dimensioned byNWRKin the dimension statement of the calling program.NWRKβ The dimension size of arrayWRKdetermined from:NDIM + 3 * (NCLASS + 1)
π¦ C-BINDING DESCRIPTION π¦
The C-binding argument descriptions are the same as the FORTRAN argument descriptions with the following exceptions:
dat1β Two dimensional real array dimensioned:dat1(2,ndim).ndimβ The size of the second dimension ofdat1as set in the dimension statement of the calling program.
πΈ USAGE πΈ
Many parameters which affect the output histogram can be set before this routine is called. See the histogram_params man page for a short functional description of all available parameters. For more detail on a specific option, see the man pages of the parameter setting routines (HSTOPC, HSTOPI, HSTOPL, or HSTOPR) used to set the parameters defining that option.
π EXAMPLES π
Use the command ncargex thstgr to generate a three frame example of various types of histograms. ncargex thstmv will show three examples of histograms with missing values in the input data.
go run them, they're literally so cute, fr fr β¨
π₯ ACCESS π₯
To use HISTGR or c_histgr, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order.
π¬ MESSAGES π¬
See the histogram man page for a description of all Histogram error messages and/or informational messages.
π SEE ALSO π
- Online:
histogram,histogram_params,hstopc,hstopi,hstopl,hstopr,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 came to you from the UNIX crew, dated March 1993 β yes she's vintage, yes she still ate π π
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms