Skip to content

Histograms not showing max value if it's exactly equal to upper border #125

@ivanpesin

Description

@ivanpesin

Histograms are excluding max values from dataset if the value is exactly equal to upper border.

Simple example:

$ echo -e '0 100\n1 200\n2 300\n3 200\n4 100' | termgraph --histogram
100.0 – 140.0: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 2.00 
140.0 – 180.0:  0.00 
180.0 – 220.0: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 2.00 
220.0 – 260.0:  0.00 
260.0 – 300.0:  0.00 

Here, 300 is missing in the histogram.

Also, histograms do not show anything if dataset consists of the same value:

$ echo $'1 100\n2 100' | termgraph --histogram
100.0 – 100.0:  0.00 
100.0 – 100.0:  0.00 
100.0 – 100.0:  0.00 
100.0 – 100.0:  0.00 
100.0 – 100.0:  0.00 

I've submitted #124 which should address the issue.

This is also what issue #66 is about.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions