Code Monkey home page Code Monkey logo

Comments (5)

janpipek avatar janpipek commented on May 22, 2024

Seems really like "histogram as bar plot kind of thing", because from the distribution-describing point of view, a bin is always a range (1.0 to 2.0, or 1.5 to 2.5).

Anyway, some approximation of what you mention should be possible (ticks="center" kind of parameter to force this). Or perhaps a generic "category" histogram solution (which I want to include) would be applicable? Let me think about it.

from physt.

nzjrs avatar nzjrs commented on May 22, 2024

Understood.

I often have quantized data with few and integer values, but nevertheless want to plot the count of. If the MPL bar plot API was not so terrible then I wouldn't file an issue here ;-)

I would not necessarily consider this as categorical data.

from physt.

janpipek avatar janpipek commented on May 22, 2024

Ok, I included (to support your use case):

  • integer binning (bins centered around integers)
  • ticks="center" argument for plot method

Example:

# Sum of two dice (should be triangle, right?)
dice = np.floor(np.random.rand(10000) * 6) + np.floor(np.random.rand(10000) * 6) + 2
histogram(dice, "integer").plot(ticks="center", density=True);

See https://github.com/janpipek/physt/blob/731d0736bb3667d455c348e9d76676df97b8e1aa/doc/Binning.ipynb for the representation :-)

Is that what you wanted?

from physt.

janpipek avatar janpipek commented on May 22, 2024

P.S. Currently supported just for matplotlib. I like bokeh but... later :-)

from physt.

nzjrs avatar nzjrs commented on May 22, 2024

Yip, that meets my use-case. Thanks a lot!

FWIW I think supporting two plotting backends is just making extra work for yourself - I think for better or worse MPL is all you need, as ugly as it can be ;-)

from physt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.