[ANN] UnitfulRecipes.jl 1.0

[ANN] UnitfulRecipes.jl 1.0

@briochemc and myself are happy to announce UnitfulRecipes.jl 1.0.

UnitfulRecipes.jl provides recipes for plotting figures (Plots.jl) when using data with units (Unitful.jl).

using Unitful, UnitfulRecipes, Plots
const a = 1u"m/s^2"
v(t) = a * t
x(t) = a/2 * t^2
t = (0:0.01:100)*u"s"
plot(x.(t), v.(t), xlabel="position", ylabel="speed")

should give something like

UnitfulRecipes.jl also interoperates well with the wider ecosystem:

using Plots, UnitfulRecipes, Unitful, UnitfulMoles, Measurements
x = collect(-10:2:30) * u"°C"
y = (50 .+ 10atan.(ustrip.(x)/10) .± 3rand.(length(x))) * u"molC/molP"
plot(x, y, ylabel="Organic matter C:P", xlabel="Water temperature", label="")

image

Head over to the documentation for more examples!

15 Likes