-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAutomatic-figure-sizing-2.jl
More file actions
31 lines (28 loc) · 1006 Bytes
/
Automatic-figure-sizing-2.jl
File metadata and controls
31 lines (28 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Translating
# https://proproplot.readthedocs.io/en/latest/subplots.html#Automatic-figure-sizing
# to Julia
# Import proplot using PyCall
using PyCall
proplot = pyimport("proplot")
#using PyPlot
# Loop through different axes widths
suptitle = "Effect of subplot properties on figure size"
for (i,axwidth) in enumerate(("4cm", "6cm"))
f, axs = proplot.subplots(ncols=2, axwidth=axwidth)
axs[1].format(
suptitle=suptitle,
title="axwidth = $axwidth", titleweight="bold",
titleloc="uc", titlecolor="red9",
)
f.savefig("figs/Automatic-figure-sizing-2a-$i.svg", transparent=false)
end
# Loop through different aspect ratios
for (i, aspect) in enumerate((1, (3,2)))
f, axs = proplot.subplots(ncols=2, nrows=2, axwidth=1.6, aspect=aspect)
axs[1].format(
suptitle=suptitle,
title="aspect = $aspect", titleweight="bold",
titleloc="uc", titlecolor="red9",
)
f.savefig("figs/Automatic-figure-sizing-2b-$i.svg", transparent=false)
end