AstroJacobLi / smplotlib

Matplotlib template for SuperMongo style 🔭
MIT License
124 stars 8 forks source link

Tick and axis thickness #4

Open gabrielastro opened 1 month ago

gabrielastro commented 1 month ago

First of all, thank you so much for making this available! A small thing: could you please make the axes and ticks thicker, more similar to the thickness of the characters? Currently, the axes are too thin, which does not look so nice and is not the classical look.

Separately, could you add a quick pointer to the README on how to use Hershey Simplex if this is easy? Just to have the option. Thanks!

By the way, I am advertising your package to colleagues :smile: and in my papers (see p. 9 of https://ui.adsabs.harvard.edu/abs/2024ApJ...964...70M for Fig. 6 and the acknowledgements) :nerd_face:.

gabrielastro commented 1 month ago

I have discovered where this is getting set: in src/smplotlib/smplot.mplstyle, with axes.linewidth: 0.7 # edge line width currently. Using axes.linewidth: 1.0 gives the right look. Currently, I load smplotlib but then have to do

import matplotlib
matplotlib.rcParams['axes.linewidth'] = 1.;

to correct this…

On a related note, for the classical (and, I think, better style), one should set:

axes.formatter.useoffset : False
axes.formatter.limits    : -4,4    # or maybe -5,5

to avoid this strange multiplicative (or additive) factor at the top of the axis. (If dividing out a factor is needed, it is clearer to do it "by hand" and indicate it in the axis label, e.g.: r'Mass ($10^3 M_{\mathrm{Sun}}$)' and plot data.mass/1e3.)

AstroJacobLi commented 1 month ago

This is awesome!! Thank you for using the package and even citing it in your paper! I really appreciate it. I'll take a look at your suggestion/question in a bit when I have time. Will keep you updated.

gabrielastro commented 1 month ago

By the way, I have not tested extensively the thickness (1.0 is probably ok, but to be checked), and for the logarithms: between 0.0001 and 10000 inclusively, the numbers should be written out, and for higher or small powers it makes sense to use the exponential notation. This is roughly the (sensible) behaviour of IDL or gnuplot, for instance (and maybe SM but I do not know). This could possibly be checked more precisely, but the main thing is to avoid those silly axes with "10⁻¹, 10⁰, 10¹" instead of just "0.1, 1, 10"… Probably, axes.formatter.min_exponent = 5 would be good.