Plotting

We provide a number of plotting routines that simplify the implementation of the material parameters

Plot CreepLaws

GeoParams.Plotting.PlotStressStrainrate_CreepLawFunction
PlotStressStrainrate_CreepLaw(x::AbstractCreepLaw; p::CreepLawParams=nothing, Strainrate=(1e-18,1e-12), CreatePlot::Bool=false)

Plots deviatoric stress versus deviatoric strain rate for a single creeplaw. Note: if you want to create plots or use the CreatePlot=true option you need to install the Plots.jl package in julia which is not added as a dependency here (as it is a rather large dependency).

Example 1

julia> x=LinearViscous()
Linear viscosity: η=1.0e20 Pa s
julia> Tau_II, Eps_II,  = PlotStressStrainrate_CreepLaw(x);

Next you can plot this with

julia> using Plots;
julia> plot(ustrip(Eps_II),ustrip(Tau_II), xaxis=:log, yaxis=:log,xlabel="strain rate [1/s]",ylabel="Dev. Stress [MPa]")

Note that ustrip removes the units of the arrays, as many of the plotting packages don't know how to deal with that.

You could also have done:

julia> using Plots;
julia> Tau_II, Eps_II, pl = PlotStressStrainrate_CreepLaw(x,CreatePlot=true);

which will generate the following plot subet1

The plot can be customized as

julia> plot(pl, title="Linear viscosity", linecolor=:red)

See the Plots.jl package for more options.

source