Comments (18)
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.
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.
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.
@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.
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.
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.
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.
Regarding the markers, this is how "Examples.ipynb" looks on my computer when I checkout and install the master branch:
The markers have to go.
from mplhep.
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.
Feel free to bring in others to the conversation, BTW ...
from mplhep.
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.
@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.
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.
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.
@henryiii Auto built docs are on the to do, but it was taking me longer than i thought
from mplhep.
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.
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.
@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)
- Use gh-action-pypi-publish v1.7.0+ APIs
- Matplotlib warnings
- Histplot errorbars HOT 3
- [Bug] histplot raises IndexError when plotting an histogram with one bin HOT 2
- Update return type of exp label/text
- CoM in Experiment label
- TypeError when plotting 2d histograms with flow="show" HOT 2
- In stack histograms, use a line color that is sligthly darker than the fill color
- compatibility issues with matplotlib 3.8.0 HOT 6
- FEAT!: make `cbarextend=True` the default for `hist2dplot` HOT 1
- feat: we should be able to combine years, lumis, and coms together HOT 4
- FIX: Investigate replacing Tex Gyre Heros Type 3 fonts with Type 1 HOT 1
- feat: support for publication information in exp_text method HOT 3
- Switch to ruff for linting
- DOCS: Failing with RTD, update or switch to a newer option
- Label formatting issue
- fix: set cbarextend=True by default only for 1 axis
- Incorrect matplotlib dependency HOT 1
- Incorrect flow bin labeling HOT 2
- Label for CMS other non-public work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mplhep.