Comments (10)
Welcome @Popinaodude could you make a PR with the style changes? @kratsg does this look ok to you since it's your work originally?
The legend position is mpl related issue. We fixed it in next release. mplhep has a helper function for it for now mplhep.r_align()
from mplhep.
labelsizes are 30
by default in ATLAS (I did the conversion from the ATLAS style guide to the matplotlib). For reference
- Rectangular plot: 800x600 px
- Square plot: 600x600 px
Since the smallest dimension is 600px for plots, and the font default is 42 (font choice=4, precision=2), this means that the text size in ATLAS (set to 0.05) will be a fraction of the pad size: 600*0.05 = 30.
from mplhep.
Perhaps it's a problem on my end, but here's the output for the same histogram at label and pad size 30 and 20 respectively:
from mplhep.
@andrzejnovak is the specification in mplhep meant to be in points or pixels? If we follow atlas style, then it should be 23/24pt, or 30 pixels.
from mplhep.
@kratsg it should be in points. The labels do look a tad large to me, but if the current numbers are what the style guide dictates we should keep it.
@Popinaodude you've found the correct way to overwrite the default settings. If you have mpl 3.3+ there are two new rcParams
#xaxis.labellocation: center # alignment of the xaxis label: {left, right, center}
#yaxis.labellocation: center # alignment of the yaxis label: {bottom, top, center}
We should probably add these to the mplhep
styles I think both ATLAS and CMS use the "right" aligned label position. Unsure about LHCb
from mplhep.
the style guide dictates 30 pixels.
from mplhep.
Ok, it should be scaled down then.
from mplhep.
@kratsg I can make a PR, does this affect other font size settings?
from mplhep.
@kratsg I can make a PR, does this affect other font size settings?
Maybe. I assumed everything was pixels, but I guess mpl uses points by default which I didn't realize.
from mplhep.
- "font.size": 18,
+ "font.size": 22,
@@ -23,2 +23,2 @@ ATLAS = {
- "axes.labelsize": 30,
- "axes.labelpad": 30,
+ "axes.labelsize": 24,
+ "axes.labelpad": 24,
@@ -26 +26 @@ ATLAS = {
- "xtick.labelsize": 19,
+ "xtick.labelsize": 14,
@@ -32 +32 @@ ATLAS = {
- "ytick.labelsize": 19,
+ "ytick.labelsize": 14,
From a cursory look, these should get changed if they were in px, to pts and get the following proportions
from mplhep.
Related Issues (20)
- [Security] Workflow publish-package.yml is using vulnerable action actions/checkout
- Suppress `yerr` drawing globally HOT 3
- mplhep styles with contourf log scale causes hang HOT 8
- Chaning colors of bars created by histplot makes bar position change HOT 2
- Add HEAD of dependencies GHA workflow HOT 1
- Upload of pytest_results artifact 'fails with no files were found' HOT 3
- `density=True` does not account for bin edges
- bug: mplhep logo placement is slow.. HOT 1
- histplot() with histtype="errorbar" crashes when data contains inf or nan HOT 3
- ENH: Add a `density` option for hist2dplot?
- mplhep LHCb2 style conflicts with subplots_adjust(hspace=0) HOT 1
- ENH: Gallery HOT 2
- CI failing HOT 1
- Add CITATION.cff
- Custom text location HOT 3
- 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
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.