Skip to content

Commit

Permalink
Add an AIP style and a hi-res modifer style.
Browse files Browse the repository at this point in the history
  • Loading branch information
gb119 committed Mar 26, 2024
1 parent 69449f5 commit 6d833be
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ Journal Styles
* nature - for Nature group journals - from the original scienceplots package
* ieee - for IEEE Transactions journals - from the original scienceplots package
* aps - for American Physical Society Journals (like Phys Rev Lett etc.)
* aip - for AIP journals such as Applied Physics Letters - labels in Serif Fonts

Modifiers
---------

* aps1.5 - Switch to 1.5 column format
* aps2.0 - Switch to 2 column format
* hi-res - Switches to 600dpi plotting (but using eps, pdf or svg is generally a better option)

Colour Cycles
-------------
Expand All @@ -73,7 +75,7 @@ The default colour cycle is based on the London Underground map colour scheme (w
* District
* Metropolitan
* Bakerloo
* JUbilee
* Jubilee
* Overground
* Victoria
* Elizabeth
Expand Down
Binary file modified examples/figures/fig02a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig02c.pdf
Binary file not shown.
Binary file modified examples/figures/fig02c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig02d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig02e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig02g.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/figures/fig02h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/fig16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 13 additions & 2 deletions examples/plot-examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,35 @@ def model(x, p):
ax.autoscale(tight=True)
ax.set(**pparam)

ax.set(**pparam)


with SavedFigure(figures / "fig02f.png", style=["stoner", "nature"], autoclose=True):
fig, ax = plt.subplots()
for p in [10, 15, 20, 30, 50, 100]:
ax.plot(x, model(x, p), label=p, marker="")
ax.legend(title="Order")
ax.autoscale(tight=True)
ax.set(**pparam)

with SavedFigure(figures / "fig02g.png", style=["stoner", "poster"], autoclose=True):
fig, ax = plt.subplots()
for p in [10, 15, 20, 30, 50, 100]:
line = ax.plot(x, model(x, p), label=p,marker="")
ax.plot(x[::5], model(x[::5], p), label=None, c=line[0].get_color(), linestyle="")
ax.legend(title="Order")
ax.autoscale(tight=True)
ax.set(**pparam)


with SavedFigure(figures / "fig02f.png", style=["stoner", "nature"], autoclose=True):
with SavedFigure(figures / "fig02h.png", style=["stoner", "aip", "hi-res"], autoclose=True):
fig, ax = plt.subplots()
for p in [10, 15, 20, 30, 50, 100]:
ax.plot(x, model(x, p), label=p, marker="")
ax.legend(title="Order")
ax.autoscale(tight=True)
ax.set(**pparam)


with SavedFigure(figures / "fig03.png", style=["stoner", "scatter"], autoclose=True):
fig, ax = plt.subplots(figsize=(4, 4))
ax.plot([-2, 2], [-2, 2], "k--")
Expand Down
33 changes: 33 additions & 0 deletions src/stonerplots/styles/journals/aip.mplstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Matplotlib style for AIP journal figures.
# In general, they advocate for all fonts to be panel labels to be sans serif
# and all font sizes in a figure to be 7 pt and panel labels to be 8 pt bold.

# Figure size
figure.figsize : 3.37, 2.17 # max width is 3.37 for single column
figure.constrained_layout.use: True
figure.dpi: 100

# Font sizes
axes.labelsize: 9
xtick.labelsize: 9
ytick.labelsize: 10
legend.fontsize: 9
figure.labelsize: small
figure.titlesize: 10
axes.titlesize: 10
font.size: 9

# Font Family
font.family: Times New Roman
font.serif: Times New Roman, Times, Palatino, Charter, DejaVu Serif, Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, serif
mathtext.fontset : dejavuserif

# Set line widths
axes.linewidth : 0.75
grid.linewidth : 0.5
lines.linewidth : 0.8
lines.markersize: 2.6


# LaTeX packages
text.latex.preamble : \usepackage{amsmath} \usepackage{amssymb} \usepackage{sfmath}
3 changes: 3 additions & 0 deletions src/stonerplots/styles/modifiers/hi-res.mplstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Push the dpi up to the typical requirement for publication. Generally using a vector bnased
# Saving format will be better.
figure.dpi: 600
6 changes: 5 additions & 1 deletion src/stonerplots/styles/stoner.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ savefig.pad_inches : 0.05
font.family : serif
mathtext.fontset : dejavuserif

#ps and pdf rendering with TrueType
pdf.fonttype: 42
ps.fonttype: 42

# Use LaTeX for math formatting
text.usetex : True
text.latex.preamble : \usepackage{amsmath,amsbsy,amsfonts,amssymb,amsxtra}
text.latex.preamble : \usepackage{amsmath,amsbsy,amsfonts,amssymb,amsxtra,mathptmx,times}

0 comments on commit 6d833be

Please sign in to comment.