Skip to content

Commit

Permalink
produce pdf figures
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldansereau committed Aug 14, 2020
1 parent 2c4b13b commit c697c7e
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 24 deletions.
Binary file added article/figures/fig2.pdf
Binary file not shown.
Binary file added article/figures/fig2d.pdf
Binary file not shown.
Binary file added article/figures/fig3.pdf
Binary file not shown.
Binary file added article/figures/fig4.pdf
Binary file not shown.
Binary file added article/figures/fig5.pdf
Binary file not shown.
Binary file added article/figures/figS1.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions code/figure2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ fig2c = plot(sol, vars = (0, 3), xlim = (5000, 6500), ylim = (7, 10.5),
) #2c

fig2 = plot(fig2a, fig2b, fig2c, layout = (3,1),
size = (500, 900), titlefontsize = 15,
tickfontsize = 15, guidefontsize = 15,
size = (500, 900), titlefontsize = 11,
tickfontsize = 8, guidefontsize = 10,
left_margin = 8Plots.mm, right_margin = 5Plots.mm,
bottom_margin = 2Plots.mm,
framestyle = :box
)
## Export figures
savefig(fig2, joinpath("..", "article", "figures", "fig2"))
savefig(fig2, joinpath("..", "article", "figures", "fig2.pdf"))
11 changes: 5 additions & 6 deletions code/figure2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ sol_y_b3 = sol_b3[2, :] # timeseries for y
sol_z_b3 = sol_b3[3, :] # timeseries for z

# Teacup Figures 2D and 5E (Three-dimensional phase plot)
gr()
fig2d = plot(sol_x_b3, sol_y_b3, sol_z_b3, # sol_b3, vars = (1,2,3),
linewidth = 0.01, linestyle = :dot,
linestyle = :dot,
xlabel = "x", xflip = false, xlim = (0.0, 1.0), xticks = 0.0:0.5:1.0,
ylabel = "y", yflip = true, ylim = (0.0, 0.5), yticks = 0.0:0.25:0.5,
zlabel = "z", zflip = false, zlim = (7.5, 10.5), zticks = 7.5:1.5:10.5,
tick_direction = :out, guidefontsize = 12, tickfontsize = 12,
tick_direction = :out, guidefontsize = 10, tickfontsize = 8,
legend = :none, size = (600, 600), c = :black,
right_margin = 5Plots.mm, left_margin = 2Plots.mm,
)
Expand All @@ -32,11 +31,11 @@ fig2d = plot(sol_x_b3, sol_y_b3, sol_z_b3, # sol_b3, vars = (1,2,3),
sol_y_b3_flip = copy(sol_y_b3)
sol_y_b3_flip = 0.5 .- sol_y_b3_flip
fig2d_flip = plot(sol_x_b3, sol_y_b3_flip, sol_z_b3, #sol_b3,vars=(1,2,3),
linewidth = 0.01, linestyle = :dot,
linestyle = :dot,
xlabel = "x", xflip = false, xlim = (0.0, 1.0), xticks = 0.0:0.5:1.0, xrotation = 30.0,
ylabel = "y", yflip = false, ylim = (0.0, 0.5), yticks = (0.0:0.25:0.5, string.(0.5:-0.25:0.0)), yrotation=-10.0,
zlabel = "z", zflip = false, zlim = (7.5, 10.5), zticks = 7.5:1.5:10.5, zrotation=0.0,
tick_direction=:out, guidefontsize = 12, tickfontsize = 12,
tick_direction=:out, guidefontsize = 10, tickfontsize = 8,
legend =:none, size = (600,600), c=:black,
right_margin = 5Plots.mm, left_margin = 2Plots.mm,
)
Expand All @@ -55,5 +54,5 @@ gr()

# Export figures
# savefig(fig2d, joinpath("..", "article", "figures", "fig2d_misplaced"))
savefig(fig2d_flip, joinpath("..", "article", "figures", "fig2d"))
savefig(fig2d_flip, joinpath("..", "article", "figures", "fig2d.pdf"))
# savefig(fig2d_pyplot, joinpath("..", "article", "figures", "fig2d_pyplot"))
10 changes: 6 additions & 4 deletions code/figure3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ plot(sol_serie1, vars = 1, xlim = (0, 500), ylim = (0, 1), c=:black, linewidth=2
u0_serie2 = [0.78, 0.16, 9.9]

prob_serie2 = ODEProblem(parameterized_model!, u0_serie2, tspan, p)
sol_serie2 = solve(prob_serie2)
sol_serie2 = solve(prob_serie2, )

fig3 = plot!(sol_serie2, vars = 1, xlim = (0, 500), ylim = (0, 1), linestyle = :dash, linewidth = 2,
grid=:none, legend = false, xlabel = "time", ylabel = "x", c = :darkgrey, framestyle = :box)
fig3 = plot!(sol_serie2, vars = 1, xlim = (0, 500), ylim = (0, 1),
c = :darkgrey, linestyle = :dash, linewidth = 2,
xlabel = "time", ylabel = "x", guidefontsize = 10,
grid = :none, legend = false, framestyle = :box)

## Export figures
savefig(fig3, joinpath("..", "article", "figures", "fig3"))
savefig(fig3, joinpath("..", "article", "figures", "fig3.pdf"))
12 changes: 6 additions & 6 deletions code/figure4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ points_maxloc = unique(hcat(B, vec(Zmaxloc)); dims = 1)
pts_maxloc = points_maxloc[points_maxloc[:,2] .> 0.00, :]
# Fig.4 A)
fig4a = scatter(pts_maxloc[:, 1], pts_maxloc[:, 2],
markersize = 1,
markersize = 2, markeralpha = 0.5,
xlim = (2.2, 3.2), ylim = (9.5, 13.0),
xlabel = "b1", ylabel = "Zmax", legend = false,
grid = :none, c = :black, msw = 0.0, msc = :black,
title = "a", titleloc = :left
)
# Fig.4 B)
fig4b = scatter(pts_maxloc[:, 1], pts_maxloc[:, 2],
markersize = 1,
markersize = 2, markeralpha = 0.5,
xlim = (3.0, 6.5), ylim = (3.0, 10.0),
xticks = 3.0:0.5:6.5, yticks = (3.0:1.0:10.0, string.(3.0:1.0:10.0)),
xlabel = "b1", ylabel = "Zmax", legend = false,
Expand All @@ -78,7 +78,7 @@ fig4b = scatter(pts_maxloc[:, 1], pts_maxloc[:, 2],
)
# Fig.4 C)
fig4c = scatter(pts_maxloc[:, 1], pts_maxloc[:, 2],
markersize = 1,
markersize = 2, markeralpha = 0.5,
xlim = (2.25, 2.6), ylim = (11.4, 12.8),
xticks = 2.25:0.05:2.60, yticks = 11.1:0.2:12.8,
xlabel = "b1", ylabel = "Zmax", legend = false,
Expand All @@ -87,12 +87,12 @@ fig4c = scatter(pts_maxloc[:, 1], pts_maxloc[:, 2],
)
# Fig.4 - Combine A,B,C
fig4 = plot(fig4a, fig4b, fig4c, layout = (3, 1),
size = (500, 900), titlefontsize = 15,
tickfontsize = 15, guidefontsize = 15,
size = (500, 900), titlefontsize = 11,
tickfontsize = 8, guidefontsize = 10,
left_margin = 10Plots.mm, right_margin = 5Plots.mm,
bottom_margin = 2Plots.mm,
framestyle = :box
)

## Export figures
savefig(fig4, joinpath("..", "article", "figures", "fig4"))
savefig(fig4, joinpath("..", "article", "figures", "fig4.pdf"))
4 changes: 2 additions & 2 deletions code/figure5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ plot!(xmin:0.01:xmax, xmin:0.01:xmax, color = :black)

# Export complete fig5
fig5 = plot(fig5a, fig5b, fig5c, fig5d, layout = 4,
titlefontsize = 10,
titlefontsize = 11, tickfontsize = 8, guidefontsize = 10,
framestyle = :box
)
savefig(fig5, joinpath("..", "article", "figures", "fig5"))
savefig(fig5, joinpath("..", "article", "figures", "fig5.pdf"))
6 changes: 3 additions & 3 deletions code/figureS1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ function b2_behavior(;b1val::Float64, b2low::Float64=1.5, b2up::Float64=3.2,out:
end
# Plot results (bifurcation diagram)
scatter(results[:,1], results[:,2],
markersize = 1,
markersize = 1, c = :black,
xlabel = "b2", xlim = (b2low,b2up), xticks = b2low:0.25:b2up,
ylabel = "Zmax", yticks = (0.0:2.0:maximum(results[:, 2]), string.(0.0:2.0:maximum(results[:, 2]))),
legend = false, grid = :none, framestyle = :box,
c = :black)
guidefontsize = 10)
end

# Examine behavior when changing b2 at b1 = 3.0
Expand All @@ -89,7 +89,7 @@ figS1_maxloc = b2_behavior(b1val = 3.0, b2low = 1.5, b2up = 3.2,
figS1_all = b2_behavior(b1val = 3.0, out = "all")

## Export figures
savefig(figS1_maxloc, joinpath("..", "article", "figures", "figS1"))
savefig(figS1_maxloc, joinpath("..", "article", "figures", "figS1.pdf"))

# Additionnal examinations
b2_behavior(b1val = 2.0)
Expand Down

0 comments on commit c697c7e

Please sign in to comment.