-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
4,174 additions
and
1,382 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION = (0, 6, 0) | ||
VERSION = (0, 7, 0) | ||
|
||
__version__ = ".".join(map(str, VERSION)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import matplotlib as mpl | ||
|
||
|
||
def figure_size(width, fraction=1): | ||
"""Set figure dimensions to avoid scaling in LaTeX. | ||
Args: | ||
width (float): Document textwidth or columnwidth in pts. | ||
fraction (float, optional) Fraction of the width which you wish the figure to occupy. | ||
Returns: | ||
tuple: Dimensions of figure in inches. | ||
""" | ||
# Width of figure (in pts) | ||
fig_width_pt = width * fraction | ||
|
||
# Convert from pt to inches | ||
inches_per_pt = 1 / 72.27 | ||
|
||
# Golden ratio to set aesthetic figure height | ||
# https://disq.us/p/2940ij3 | ||
golden_ratio = (5**0.5 - 1) / 2 | ||
|
||
# Figure width in inches | ||
fig_width_in = fig_width_pt * inches_per_pt | ||
# Figure height in inches | ||
fig_height_in = fig_width_in * golden_ratio | ||
|
||
fig_dim = (fig_width_in, fig_height_in) | ||
|
||
return fig_dim | ||
|
||
|
||
def update_matplotlib_rc(width=252 * 1.8, fraction=1.0, fontsize=10): | ||
mpl.rcParams.update( | ||
{ | ||
"figure.figsize": figure_size(width=width, fraction=fraction), | ||
"figure.facecolor": "white", | ||
"figure.edgecolor": "white", | ||
"savefig.dpi": 360, | ||
"figure.subplot.bottom": 0.5, | ||
# Use LaTeX to write all text | ||
"text.usetex": True, | ||
# "font.family": "serif", | ||
# Use 10pt font in plots, to match 10pt font in document | ||
"axes.labelsize": fontsize, | ||
"font.size": fontsize, | ||
# Make the legend/label fonts a little smaller | ||
"legend.fontsize": fontsize - 3, | ||
"xtick.labelsize": fontsize - 1, | ||
"ytick.labelsize": fontsize - 1, | ||
# tight layout, | ||
"figure.autolayout": True, | ||
} | ||
) |
Oops, something went wrong.