# Makie diffeq recipes

**URL:** <https://discourse.julialang.org/t/makie-diffeq-recipes/110078>\
**Category:** Visualization\
**Tags:** diffeq, makie, recipe\
**Created:** [February 11, 2024, 7:57pm UTC](https://discourse.julialang.org/t/makie-diffeq-recipes/110078 "2024-02-11T19:57:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![henry2004y](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henry2004y/32/9284_2.png) [@henry2004y](https://discourse.julialang.org/u/henry2004y)\
**Post date:** [February 11, 2024, 7:57pm UTC](https://discourse.julialang.org/t/makie-diffeq-recipes/110078/1 "2024-02-11T19:57:57Z")

</div>

Recently a new [Makie recipe](https://github.com/SciML/SciMLBase.jl/blob/master/ext/SciMLBaseMakieExt.jl) for DifferentialEquations was added using `PlotSpec`. However, I noticed that at least two things are not working:

1. Line attributes are ignored. For example, `linestyle` and `linewidth` are always set to default values:

```julia
using OrdinaryDiffEq # v6.70.1
using GLMakie # v0.9.8

function lorenz(du,u,p,t)
    du[1] = p[1]*(u[2]-u[1])
    du[2] = u[1]*(p[2]-u[3]) - u[2]
    du[3] = u[1]*u[2] - p[3]*u[3]
end

u0 = [1., 5., 10.]
tspan = (0., 100.)
p = (10.0,28.0,8/3)
prob = ODEProblem(lorenz, u0, tspan,p)
sol = solve(prob, Tsit5())
f, ax, pl = lines(sol, linestyle=:dot) # linestyle is always :solid!

```

When I tried to modify the attributes for the 1st issue

```julia
ax.scene.plots[1].linestyle = :dash

```

it returned an error `ERROR: cannot convert a value to nothing for assignment`.

1. Plot transformation (e.g. scale!) has no effect

```julia
using OrdinaryDiffEq
using GLMakie

function lorenz(du,u,p,t)
    du[1] = p[1]*(u[2]-u[1])
    du[2] = u[1]*(p[2]-u[3]) - u[2]
    du[3] = u[1]*u[2] - p[3]*u[3]
end

u0 = [1., 5., 10.]
tspan = (0., 100.)
p = (10.0,28.0,8/3)
prob = ODEProblem(lorenz, u0, tspan,p)
sol = solve(prob, Tsit5())

f, ax, pl = plot(sol)
axislegend(ax)
# This is not working! Should become 0 - 1000 for the x axis but still keep the original 0-100
scale!(pl, 10, 1)

f

```

We may for now choose to scale each child plot individually like

```julia
scale!(ax.scene.plots[1], 10, 1) # scale x-axis by 10

```

Before the official fix to these [reported issues](https://github.com/MakieOrg/Makie.jl/issues/3623), how can we currently work around them?
