Comments (9)
yeah this was just about being able to transparenttly arrange a set of ratio plots similar to subplots..
from mplhep.
Hi @lukasheinrich could you share the code for this? I have been looking for something similar.
from mplhep.
fwiw it seems to play nice with mplhep
from mplhep.
That's kinda neat. I collect similar helper functions in mplhep.plot
as well, though they're not well documented yet. A PR is welcome! One thing that feels kinda weird is having the subplot as a dict with main
and aux
could it be a tuple instead?
from mplhep.
hmm or better yet, two arrays like fig, ax, subax = ...
then the shape is clear and you can iterate over both with zip
from mplhep.
There is a ratioplot utility in coffea that might be able to be ported over, as was done for the others: https://coffeateam.github.io/coffea/api/coffea.hist.plotratio.html
from mplhep.
The problem with this is that the type of plots that ATLAS, LHCb, etc will accept for publication should look more like:
I won't use anything that looks radically different because at the end the collaboration will make us change it so that it looks like the standard style. For which I would end up using the old ROOT way of doing things anyway.
from mplhep.
@acampove I am not sure I follow. This issue is about automating layout for multiple subplots. The styling is separate and fairly straightforward.
import matplotlib.pyplot as plt
import mplhep as hep
import numpy as np
hists = [np.histogram(np.random.normal(i, 2, 10000), bins=np.linspace(0, 10, 50)) for i in [4, 5, 6]]
hep.histplot(hists[:2])
hep.histplot(hists[2], histtype='errorbar')
hep.style.use('ATLAS')
hep.histplot(hists[:2], color=['black', 'red'], label=['mc1', 'mc2'])
hep.histplot(hists[2], histtype='errorbar', color='k', yerr=True, label='Data')
plt.legend()
from mplhep.
@andrzejnovak Yes, I did not know that switching from that matplotlib style to an ATLAS style was that simple and that the layout was so easy to change.
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.