Skip to content

Commit 8a49b8a

Browse files
echedey-lsJBorrow
andauthored
Use the other alternative proposed in #93 (#107)
* Even a better fix to #30 Co-Authored-By: Josh Borrow <[email protected]> * Update examples to showcase `no-latex` + `science` --------- Co-authored-by: Josh Borrow <[email protected]>
1 parent 26eb00a commit 8a49b8a

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Examples
7777

7878
The basic ``science`` style is shown below:
7979

80-
<img src="https://github.com/garrettj403/SciencePlots/raw/master/examples/figures/fig01.jpg" width="500">
80+
<img src="https://github.com/garrettj403/SciencePlots/raw/master/examples/figures/fig01a.jpg" width="500">
8181

8282
It can be cascaded with other styles to fine-tune the appearance. For example, the ``science`` + ``notebook`` styles (intended for Jupyter notebooks):
8383

Loading

examples/figures/fig01b.jpg

62.6 KB
Loading

examples/plot-examples.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@ def model(x, p):
2929
ax.legend(title='Order')
3030
ax.autoscale(tight=True)
3131
ax.set(**pparam)
32-
fig.savefig('figures/fig01.jpg', dpi=300)
32+
fig.savefig('figures/fig01a.jpg', dpi=300)
33+
plt.close()
34+
35+
with plt.style.context(['science', 'no-latex']):
36+
fig, ax = plt.subplots()
37+
for p in [10, 15, 20, 30, 50, 100]:
38+
ax.plot(x, model(x, p), label=p)
39+
ax.legend(title='Order')
40+
ax.autoscale(tight=True)
41+
ax.set(**pparam)
42+
fig.savefig('figures/fig01b.jpg', dpi=300)
3343
plt.close()
3444

3545
with plt.style.context(['science', 'ieee']):

scienceplots/styles/misc/no-latex.mplstyle

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
text.usetex : False
55

6-
# Stix is designed to look similar to Times.
7-
font.family: STIXGeneral
8-
mathtext.fontset: stix
6+
# Set fonts to be LaTeX defaults
7+
font.serif : cmr10, Computer Modern Serif, DejaVu Serif
8+
font.family : serif
9+
axes.formatter.use_mathtext : True
10+
mathtext.fontset : cm

0 commit comments

Comments
 (0)