Code Monkey home page Code Monkey logo

Comments (10)

andrzejnovak avatar andrzejnovak commented on September 4, 2024

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.

kratsg avatar kratsg commented on September 4, 2024

labelsizes are 30 by default in ATLAS (I did the conversion from the ATLAS style guide to the matplotlib). For reference

ATLAS dictates:

  • 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.

KeanuGh avatar KeanuGh commented on September 4, 2024

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:

testplot_nofix
testplot_fixedstyle

from mplhep.

kratsg avatar kratsg commented on September 4, 2024

@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.

andrzejnovak avatar andrzejnovak commented on September 4, 2024

@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

[1]
image

from mplhep.

kratsg avatar kratsg commented on September 4, 2024

the style guide dictates 30 pixels.

from mplhep.

andrzejnovak avatar andrzejnovak commented on September 4, 2024

Ok, it should be scaled down then.

from mplhep.

andrzejnovak avatar andrzejnovak commented on September 4, 2024

@kratsg I can make a PR, does this affect other font size settings?

from mplhep.

kratsg avatar kratsg commented on September 4, 2024

@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.

andrzejnovak avatar andrzejnovak commented on September 4, 2024
-    "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
image

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.