-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAutomatic-figure-sizing-3.jl
More file actions
38 lines (34 loc) · 1.12 KB
/
Automatic-figure-sizing-3.jl
File metadata and controls
38 lines (34 loc) · 1.12 KB
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
32
33
34
35
36
37
# Translating
# https://proplot.readthedocs.io/en/latest/subplots.html#Automatic-figure-sizing
# to Julia
# Import proplot using PyCall
using PyCall
proplot = pyimport("proplot")
# Changing the reference subplot in the presence of unequal width/height ratios
suptitle = "Effect of reference subplot on figure size"
for ref in (1, 2)
f, axs = proplot.subplots(
ref=ref, nrows=3, ncols=3, wratios=(3, 2, 2),
axwidth=1.1,
)
axs[ref].format(
suptitle=suptitle,
title="reference axes", titleweight="bold",
titleloc="uc", titlecolor="red9"
)
f.savefig("figs/Automatic-figure-sizing-3a-$ref.svg", transparent=false)
end
# Changing the reference subplot in a complex grid
for (i,ref) in enumerate((3, 2))
f, axs = proplot.subplots(
[[1, 1, 2], [3, 4, 4]],
hratios=(1, 1.5), wratios=(3, 2, 2),
ref=ref, axwidth=1.1, span=false
)
axs[ref].format(
suptitle=suptitle,
title="reference axes", titleweight="bold",
titleloc="uc", titlecolor="red9"
)
f.savefig("figs/Automatic-figure-sizing-3b-$i.svg", transparent=false)
end