Giter Club home page Giter Club logo

Comments (18)

henryiii avatar henryiii commented on June 15, 2024 1

I could probably force set them in the function, but that's not great.

Unless the markers get drawn at every corner (Mickey-mouse style), they really are not even correct and would probably not ever be useful and could be forced off, I would think.

from mplhep.

andrzejnovak avatar andrzejnovak commented on June 15, 2024 1

Fair enough, I can't imagine a use case where one would actually want to show those markers, so I think we can hard-code it.

from mplhep.

eduardo-rodrigues avatar eduardo-rodrigues commented on June 15, 2024

I agree with this - what is "default" now is not what we in HEP take it as default. The whole point of mplhep is to provide a simple, handy and HEP-like interface atop matplotlib, right?

@andrzejnovak, shall we try and take in community input to improve the package? You should feel more than free to discuss APIs and anything relevant on the Gitter channel, to converge at best. To me this suggestion makes sense and should be taken on board asap.

Thanks.

from mplhep.

andrzejnovak avatar andrzejnovak commented on June 15, 2024

@HDembinski I am not 100% sure what you mean about the markers.

Re edges, there was a discussion somewhere in matplotlib/matplotlib#6669, https://docs.google.com/document/d/1ju3JObrPEyT7QpCx3m1YoVp0gFbLay8ZIxtO0mUCvgo/edit# and the gitter about this and one point that resonated with me is that drawing the edges seems to make a statement about the distribution end which is usually not the case.

I'm open to changing it but would like a better reason than that's how ROOT does it.

from mplhep.

eduardo-rodrigues avatar eduardo-rodrigues commented on June 15, 2024

Apologies for chiming in again. In the end the edges are just reflecting the binning structure and the contents per bin, no? So, once you make a binned plot the edges just fall to zero if no entries are in the bin(s) after. Seems natural to me. Nothing to do with what ROOT does ;-).

from mplhep.

andrzejnovak avatar andrzejnovak commented on June 15, 2024

From matplotlib/matplotlib#6669

"Note that it does not cause the line to go to zero at the end, as we want--we have no information about this empirical PDF outside the specified binning."

In the proposed setup the edge does not bring additional information to the plot, but if you interpret it as such it can send the wrong message.

from mplhep.

HDembinski avatar HDembinski commented on June 15, 2024

Full agreement with Eduardo. Also, when you fill the histogram with solid color, you also see the first and last edge. The natural expectation is that a non-filled histogram shows the outline of the filled region, hence also the first and last edge.

from mplhep.

HDembinski avatar HDembinski commented on June 15, 2024

Regarding the markers, this is how "Examples.ipynb" looks on my computer when I checkout and install the master branch:

grafik

The markers have to go.

from mplhep.

eduardo-rodrigues avatar eduardo-rodrigues commented on June 15, 2024

On your posting

"Note that it does not cause the line to go to zero at the end, as we want--we have no information about this empirical PDF outside the specified binning."
: this is not relevant for 99% of histograms one produce, where you're not doing a likelihood fit with a model containing several PDFs. I mean, most histograms we plot have nothing to do with PDFs. It's just that you literally plot the data and empty bins are just that. Also, the end of a histogram shows there is no data/MC data beyond that point or in the next bin(s).

Hans's comment on filled histograms are ever more clear/strong.

from mplhep.

eduardo-rodrigues avatar eduardo-rodrigues commented on June 15, 2024

Feel free to bring in others to the conversation, BTW ...

from mplhep.

henryiii avatar henryiii commented on June 15, 2024

Copying my comment from the IRIS-HEP Slack, histograms are really outlines of a bar plot, we just generally remove the inner lines for clarity. Removing the outer lines does not work, it ruins the outline.

from mplhep.

andrzejnovak avatar andrzejnovak commented on June 15, 2024

@HDembinski you must be doing something to your rcParams. The whole plot looks neither like the mpl default or any of the mplhep styles.

Otherwise the markers (not usually visible) are a result of the the implementation of the underlying mpl function.

I could probably force set them in the function, but that's not great.

from mplhep.

henryiii avatar henryiii commented on June 15, 2024

Can I recommend a few example notebooks, integrated into docs using nbsphinx, that are run automatically? It would be great for seeing examples of what the plots and styles look like. @andrzejnovak I can help you set it up if you want me do. See Boost-histogram's example section.

from mplhep.

henryiii avatar henryiii commented on June 15, 2024

There's also JupyterBook, if you don't plan to have Sphinx for any of the other docs. Example (not mine): https://cranmer.github.io/madminer-tutorial/intro

from mplhep.

andrzejnovak avatar andrzejnovak commented on June 15, 2024

@henryiii Auto built docs are on the to do, but it was taking me longer than i thought

from mplhep.

andrzejnovak avatar andrzejnovak commented on June 15, 2024

As i said, i am willing to change default, but i am surprised how strongly people feel about this, given it's entirely cosmetic and doesn't carry any more information than without edges.

I do suspect this is more than anything to do with just being used to it looking the way it does in ROOT.

from mplhep.

henryiii avatar henryiii commented on June 15, 2024

JuptyerBooks are really easy (I converted this class in a couple of hours of meetings), though I haven't built one into GHA yet (on my do list), I can send you a ping whenever I do that if you think that is a way you might want to go. If you are interested in the Sphinx route, then boost-histogram is an example that might be useful (I have auto building off there, since the C++ parts are not built on ReadTheDocs).

from mplhep.

HDembinski avatar HDembinski commented on June 15, 2024

@andrzejnovak I am not doing anything special in my rcParams, and anyway, the markers should never be drawn whatever I have in my rcParams.

from mplhep.

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.