Visitar URL original
Making histogram · Issue #59 · glamp/bashplotlib · GitHub
Skip to content

Making histogram #59

Description

@ChopsKingsland

I am trying to display a histogram, and it doesn't work, but instead prints -----------... My code is

with open("cpuhistory.txt", "r") as n:

    plot_hist(n)
    n.close()

and cpuhistory.txt is https://pastebin.com/vPMBTxzJ .

How can I get it working?

Activity

  1. notionparallax commented on Jan 22, 2022

    @notionparallax

    The following code works for me with your data:

    from bashplotlib.histogram import plot_hist
    
    with open("cpuhistory.txt", "r") as n:
        plot_hist(
            list(n),
            height=10,
            xlab=True,
            showSummary=True,
            bincount=20,
        )
    

    which gives:

     24|   o
     21|   o
     19|   o
     16|   o
     14|   oo
     11|  ooo
      8|  ooo
      6|  ooo
      3|  oooo
      1| oooooo      o       o
        ---------------------
        1 2 3 4 5 6 7 9 1 1 1
        . . . . . . . . 0 1 2
        5 5 6 7 7 8 9 0 . . .
        0 8 5 2 9 6 3 0 0 1 2
    
    ----------------------------------
    |            Summary             |
    ----------------------------------
    |        observations: 61        |
    |      min value: 1.509434       |
    |        mean : 2.683872         |
    |      max value: 12.218891      |
    ----------------------------------
    

    It also works without the extra args.

    It's not possible that it was scrolling the rest of the histogram off the screen is it?

  2. whillas-yabble commented on Oct 12, 2022

    @whillas-yabble

    x-labels are double spaced but the graph is not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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