Skip to content

Commit e05440b

Browse files
committed
handle imports nicer
1 parent 03cbb43 commit e05440b

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

lib/ControlSystemsBase/ext/ControlSystemsBaseMakieExt.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ function CSMakie.bodeplot!(fig, systems::Union{LTISystem, AbstractVector{<:LTISy
151151

152152
if adaptive && eltype(magdata) <: AbstractFloat
153153
wsi, magi, _ = downsample(ws, magdata, _span(magdata)/500)
154-
lines!(ax_mag, wsi, magi, label=lab)
154+
lines!(ax_mag, wsi, magi; label=lab, kwargs...)
155155
else
156-
lines!(ax_mag, ws, magdata, label=lab)
156+
lines!(ax_mag, ws, magdata; label=lab, kwargs...)
157157
end
158158

159159
# Plot phase
@@ -173,9 +173,9 @@ function CSMakie.bodeplot!(fig, systems::Union{LTISystem, AbstractVector{<:LTISy
173173
if adaptive && eltype(phasedata) <: AbstractFloat
174174
wsp, phasep, _ = downsample(ws, phasedata,
175175
_span(phasedata)/500)
176-
lines!(ax_phase, wsp, phasep)
176+
lines!(ax_phase, wsp, phasep; kwargs...)
177177
else
178-
lines!(ax_phase, ws, phasedata)
178+
lines!(ax_phase, ws, phasedata; kwargs...)
179179
end
180180
end
181181
end

lib/ControlSystemsBase/test/test_makie_plots.jl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using ControlSystemsBase
22
using Test
33
using LinearAlgebra
4-
using CairoMakie
4+
import CairoMakie
5+
import CairoMakie.Makie
56

67
@testset "Makie Plot Tests" begin
78
# Create test systems
@@ -126,13 +127,13 @@ using CairoMakie
126127
t = 0:0.01:5
127128
res = step(P, t)
128129
@test_nowarn begin
129-
fig = plot(res)
130-
plot!(fig[1,2], res)
130+
fig = Makie.plot(res)
131+
Makie.plot!(fig[1,2], res)
131132
@test fig isa Makie.Figure
132133
end
133134
@test_nowarn begin
134-
fig = plot(res; plotu=true, plotx=true)
135-
plot!(fig[1,2], res, plotu=true, plotx=true)
135+
fig = Makie.plot(res; plotu=true, plotx=true)
136+
Makie.plot!(fig[1,2], res, plotu=true, plotx=true)
136137
@test fig isa Makie.Figure
137138
end
138139
end
@@ -141,8 +142,8 @@ using CairoMakie
141142
res = step(P, 100)
142143
si = stepinfo(res)
143144
@test_nowarn begin
144-
fig = plot(si)
145-
plot!(fig[1,2], si)
145+
fig = Makie.plot(si)
146+
Makie.plot!(fig[1,2], si)
146147
@test fig isa Makie.Figure
147148
end
148149
end

0 commit comments

Comments
 (0)