Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Makie to v0.20 releases #150

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
BibTeX = "0.1"
DelimitedFiles = "1.0"
ForwardDiff = "0.10"
GLMakie = "0.8"
GLMakie = "0.8, 0.9"
Interpolations = "0.13, 0.14"
KernelDensitySJ = "0.2"
LaTeXStrings = "1.2"
Expand Down
34 changes: 17 additions & 17 deletions src/Plotting/Plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function PlotStrainrateStress(
n = length(x)
end
if isnothing(fig)
fig = Figure(; fontsize=25, resolution=res)
fig = Figure(; fontsize=25, size=res)
end
ax = Axis(
fig[1, 1];
Expand Down Expand Up @@ -258,7 +258,7 @@ function PlotStressStrainrate(
end

if isnothing(fig)
fig = Figure(; fontsize=25, resolution=res)
fig = Figure(; fontsize=25, size=res)
end
ax = Axis(
fig[1, 1];
Expand Down Expand Up @@ -349,7 +349,7 @@ function PlotStrainrateViscosity(
end

if isnothing(fig)
fig = Figure(; fontsize=25, resolution=res)
fig = Figure(; fontsize=25, size=res)
end
ax = Axis(
fig[1, 1];
Expand Down Expand Up @@ -453,7 +453,7 @@ function PlotStressViscosity(
end

if isnothing(fig)
fig = Figure(; fontsize=25, resolution=res)
fig = Figure(; fontsize=25, size=res)
end
ax = Axis(
fig[1, 1];
Expand Down Expand Up @@ -771,12 +771,12 @@ function Plot_TAS_diagram(; displayLabel=true)
ClassTASdata = TASclassificationData()
@unpack litho, n_ver, ver = ClassTASdata

f = Figure(resolution = (1100, 1100), fontsize = 18)
f = Figure(size = (1100, 1100), fontsize = 18)
p1 = GridLayout(f[1, 1])
ax1 = Axis(
p1[1, 1],
xlabel = "SiO2 [wt%]",
ylabel = "Na2O+K2O [wt%]",
p1[1, 1],
xlabel = "SiO2 [wt%]",
ylabel = "Na2O+K2O [wt%]",
title = "TAS Diagram",
aspect = 1,
xticks = 35:5:100,
Expand All @@ -802,7 +802,7 @@ function Plot_TAS_diagram(; displayLabel=true)
if displayLabel
p2 = GridLayout(f[1, 2])
ax2 = Axis(
p2[1, 1],
p2[1, 1],
bottomspinevisible = false,
xgridvisible = false,
ygridvisible = false,
Expand Down Expand Up @@ -862,7 +862,7 @@ function PlotStressTime_0D(
end

if isnothing(fig)
fig = Figure(; fontsize=25, resolution=res)
fig = Figure(; fontsize=25, size=res)
end
ax = Axis(
fig[1, 1];
Expand Down Expand Up @@ -953,7 +953,7 @@ julia> PlotDeformationMap(v, strainrate=false, viscosity=true, levels=Vector(18
"""
function PlotDeformationMap(
v;
args=(P=0.0, T=1250, d=3e-3, f=1.0),
args=(P=0.0, T=1250, d=3e-3, f=1.0),
d = (1e-6, 1e-1), # in m
σ = (1e-2, 1e8), # in MPa
T = (10, 1000), # in C
Expand Down Expand Up @@ -1007,9 +1007,9 @@ function PlotDeformationMap(
end
εII[i] = compute_εII(v, τlocal, args_local) # compute strainrate (1/s)
ε_components = [ compute_εII(v[i], τlocal, args_local) for i=1:n_components];
ε_components = ε_components./sum(ε_components)
mainDef[i] = argmax(ε_components) # index of max. strainrate
end
ε_components = ε_components./sum(ε_components)
mainDef[i] = argmax(ε_components) # index of max. strainrate
end
log_σ = log10.(σ_vec./1e6)
else
# compute τ as a function of ε and T
Expand Down Expand Up @@ -1064,7 +1064,7 @@ function PlotDeformationMap(
end

# Plotting with Makie
fig = Figure(; fontsize=fontsize, resolution=res)
fig = Figure(; fontsize=fontsize, size=res)

ax = Axis(
fig[1,1],
Expand All @@ -1085,7 +1085,7 @@ function PlotDeformationMap(
# plot boundaries between deformation regimes
contour!(ax,x,y,mainDef, color=:red, linewidth=2, linestyle=:solid, levels=n_components-1)
end

contour!(ax,x,y,data; color=:black, levels=-20:1:-2, labels = true, labelsize = 25, labelfont = :bold, labelcolor = :black)

Colorbar(fig[1,2], c1, label=label, labelsize=fontsize)
Expand Down Expand Up @@ -1137,7 +1137,7 @@ function PlotPressureStressTime_0D(
end

if isnothing(fig)
fig = Figure(; fontsize=25, resolution=res)
fig = Figure(; fontsize=25, size=res)
end
if τ_scale == 1.0
ylabel_str = "Deviatoric stress";
Expand Down
2 changes: 1 addition & 1 deletion src/Plotting/StrengthEnvelope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function StrengthEnvelopePlot(MatParam::NTuple{N, AbstractMaterialParamsStruct},
end

# build Figure
fig = Figure(resolution = (1200, 900));
fig = Figure(size = (1200, 900));
ax1 = fig[1, 1:3] = Axis(fig,
# title
title = title,
Expand Down