PLBIN(3plplot)

πŸ’– PLBIN β€” plot a histogram from binned data πŸ’–

ok so bestie, welcome to the plbin page from the PLplot API manual (that's the 3plplot one, iykyk) 🌸 this is the whole thing, every flag, every vector, no skips, no cap.


✨ SYNOPSIS ✨

plbin(nbin, x, y, opt)

πŸŽ€ DESCRIPTION πŸŽ€

Bestie, this function plots a histogram. Specifically, it plots one made of nbin bins. The value that goes with the i'th bin lives in x[i], and the number of points sitting in that bin goes in y[i].

⚠️ For proper operation, the values in x[i] must form a strictly increasing sequence. Not vibing with that rule? The function will not be having a good time. 😭

By default, x[i] is the left-hand edge of the i'th bin. But if you pass opt=PL_BIN_CENTRED, the bin boundaries get placed midway between the values in the x vector instead. Slay, shifted boundaries πŸ’…

Also, if you're out here with raw unbinned data and you wanna draw a histogram from that, go check out plhist(3plplot) β€” different function, different vibe, same histogram energy πŸ¦‹

Redacted form: General: plbin(x, y, opt) Python: plbin(nbin, x, y, opt)

This function is not used in any examples. (yes, really β€” she's a supporting character, not a main character, and that's okay 🫢)


🧚 ARGUMENTS 🧚

  • nbin (PLINT(3plplot), input) β€” the number of bins. Basically the number of values living in the x and y vectors, so like, keep those consistent bestie.
  • x (PLFLT_VECTOR(3plplot), input) β€” a vector holding the values associated with the bins. And once again for the people in the back: these must form a strictly increasing sequence πŸ“ˆ no exceptions, no chaos.
  • y (PLFLT_VECTOR(3plplot), input) β€” a vector holding a number which is proportional to the number of points in each bin. Note the glow-up: this is a PLFLT vector and not a PLINT vector, and that's on purpose β€” it's so you can do histograms of probabilities and stuff like that. Iconic, flexible, we love her πŸ’œ
  • opt (PLINT(3plplot), input) β€” a combination of several flags, and here's the full rundown:
    • opt=PL_BIN_DEFAULT: the x values represent the lower bin boundaries, the outer bins are expanded to fill up the entire x-axis, and bins of zero height are simply drawn. Default behaviour, no notes.
    • opt=PL_BIN_CENTRED|...: the bin boundaries are placed midway between the x values. If the values in x are equally spaced, then the values are the center values of the bins. Cute.
    • opt=PL_BIN_NOEXPAND|...: the outer bins are drawn with equal size as the ones inside. No stretching, everything same size, equal treatment periodt.
    • opt=PL_BIN_NOEMPTY|...: bins with zero height are not drawn β€” so there's a gap for such bins. Empty bins get left on read πŸ’€

πŸ‘‘ AUTHORS πŸ‘‘

Many developers (who are credited at http://plplot.sourceforge.net/credits.php) have contributed to PLplot over its long history. That's a whole squad of legends, honestly, the way they've been carrying this library 🫢✨


🌈 SEE ALSO 🌈

PLplot documentation at http://plplot.sourceforge.net/documentation.php. Go read it, it's giving knowledge πŸ’–


k bye bestie, go plot some bins β€” this was PLBIN(3plplot) from the PLplot API manual, dated August, 2026 πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from