Skip to content

Commit 398a458

Browse files
authored
Replace AbstractPlotting.jl with Makie.jl (#122)
* Replace AbstractPlotting.jl with Makie.jl * swap dep
1 parent e0d3620 commit 398a458

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ authors = ["Lorenz Ohly", "Julia Community"]
44
version = "0.1.0"
55

66
[deps]
7-
AbstractPlotting = "537997a7-5e4e-5d89-9595-2241ea00577e"
87
Animations = "27a7e980-b3e6-11e9-2bcd-0b925532e340"
98
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
109
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
@@ -21,6 +20,7 @@ FluxTraining = "7bf95e4d-ca32-48da-9824-f0dc5310474f"
2120
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
2221
LearnBase = "7f8f8fb0-2700-5f03-b4bd-41f8cfc144b6"
2322
MLDataPattern = "9920b226-0b2a-5f5f-9153-9aa70a013f8b"
23+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
2424
MosaicViews = "e94cdb99-869f-56ef-bcf0-1ae2bcbe0389"
2525
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
2626
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
@@ -31,7 +31,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3131
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
3232

3333
[compat]
34-
AbstractPlotting = "0.17, 0.18"
3534
Animations = "0.4"
3635
BSON = "0.3"
3736
Colors = "0.12"

src/FastAI.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using Reexport
99
@reexport using Flux
1010

1111
using Animations
12-
using AbstractPlotting
12+
using Makie
1313
using Colors
1414
using DataAugmentation
1515
using DataAugmentation: getbounds, Bounds

src/plotting.jl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ end
123123
# ## Utilities
124124

125125
function imageaxis(f; kwargs...)
126-
ax = AbstractPlotting.Axis(f; kwargs...)
126+
ax = Makie.Axis(f; kwargs...)
127127
ax.aspect = DataAspect()
128128
ax.xzoomlock = true
129129
ax.yzoomlock = true
@@ -143,16 +143,26 @@ function imageaxis(f; kwargs...)
143143
end
144144

145145

146-
imageaxis(f::AbstractPlotting.FigurePosition; kwargs...) = imageaxis(f.fig; kwargs...)
146+
imageaxis(f::Makie.FigurePosition; kwargs...) = imageaxis(f.fig; kwargs...)
147147

148148
# ## Plot recipes
149149

150150

151151
@recipe(PlotImage, image) do scene
152-
Attributes()
152+
Attributes(;
153+
#=
154+
default_theme(scene)...,
155+
colormap = [:black, :white],
156+
colorrange = automatic,
157+
interpolate = true,
158+
fxaa = false,
159+
lowclip = nothing,
160+
highclip = nothing,
161+
=#
162+
)
153163
end
154164

155-
function AbstractPlotting.plot!(plot::PlotImage)
165+
function Makie.plot!(plot::PlotImage)
156166
im = plot[:image]
157167
rim = @lift copy(rotr90($im))
158168
image!(plot, rim; plot.attributes...)
@@ -164,7 +174,7 @@ end
164174
Attributes()
165175
end
166176

167-
function AbstractPlotting.plot!(plot::PlotMask; kwargs...)
177+
function Makie.plot!(plot::PlotMask; kwargs...)
168178
mask = plot[:mask]
169179
classes = try
170180
classes = plot[:classes]

src/training/lrfind.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function plotlrfind(lrs, losses)
9292
ax.yticklabelsize = 10.
9393

9494

95-
AbstractPlotting.lines!(ax, log.(lrs), log.(losses), axis = (xticks = LinearTicks(10),))
95+
Makie.lines!(ax, log.(lrs), log.(losses), axis = (xticks = LinearTicks(10),))
9696
return f
9797
end
9898

0 commit comments

Comments
 (0)