GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — histogram: Support density histograms and more · Issue #9212 · GenericMappingTools/gmt

histogram: Support density histograms and more #9212

New issue
Copy link
New issue
Copy link
Open
#9229
Open
histogram: Support density histograms and more#9212
#9229
Copy link
Assignees
Esteban82
Labels
feature requestRequest a new feature

Description

@seisman
seisman
opened on Sep 16, 2026
Issue body actions

Currently, GMT's histogram supports counts and frequency (in percentage) histograms via the -Z option. There are some other useful histograms, e.g., density histogram, which is not supported by GMT yet.

For comparison, matplotlib's hist methods supports "counts" and "density" histograms, while seaborn's histplot method supports more types (see the stat parameter):

  • count: show the number of observations in each bin [Supported by GMT]
  • frequency: show the number of observations divided by the bin width [Not supported by GMT]
  • probability or proportion: normalize such that bar heights sum to 1 [Not supported by GMT]
  • percent: normalize such that bar heights sum to 100 [Supported by GMT, but GMT calls it "frequency_percent"]
  • density: normalize such that the total area of the histogram equals 1 [Not supported by GMT]

Here's the math summarized by Claude [the correctness is not confirmed yet].

With n = count in a bin, N = total data points, w = the bin's width.

stat formula bars sum to area under bars
count n N N·w
frequency n / w N/w N
probability (alias proportion) n / N 1 w
percent 100·n / N 100 100·w
density n / (N·w) 1/w 1

percent is just probability × 100, so there are really only four distinct quantities. density is the only one that is both normalized and per-unit-x, which is why it's the one with area = 1 and the only one directly comparable to a probability density function.

Activity

  1. seisman
    added
    feature requestRequest a new feature
    on Sep 16, 2026
  2. Esteban82
    self-assigned this
    on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Esteban82
    Esteban82

Labels

feature requestRequest a new feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.