Skip to content

Instantly share code, notes, and snippets.

@danhey
Created October 9, 2019 11:15
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danhey/56c3737c0e4c14fee768c83e09f3f745 to your computer and use it in GitHub Desktop.
Save danhey/56c3737c0e4c14fee768c83e09f3f745 to your computer and use it in GitHub Desktop.
def mnras_size(fig_width_pt, square=False):
inches_per_pt = 1.0/72.00 # Convert pt to inches
golden_mean = (np.sqrt(5)-1.0)/2.0 # Most aesthetic ratio
fig_width = fig_width_pt*inches_per_pt # Figure width in inches
if square:
fig_height = fig_width
else:
fig_height = fig_width*golden_mean
return [fig_width,fig_height]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment