-
Notifications
You must be signed in to change notification settings - Fork 0
/
denoisinganalysis.jl
68 lines (63 loc) · 2.71 KB
/
denoisinganalysis.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using CSV, DataFrames, Gadfly, Compose
# import files
blocks = CSV.read("./results/blocks.csv", DataFrame)
bumps = CSV.read("./results/bumps.csv", DataFrame)
heavisine = CSV.read("./results/heavisine.csv", DataFrame)
doppler = CSV.read("./results/doppler.csv", DataFrame)
quadchirp = CSV.read("./results/quadchirp.csv", DataFrame)
mishmash = CSV.read("./results/mishmash.csv", DataFrame)
# build plots
function makeplot(df::DataFrame, main::AbstractString)
# start theme
fonts = Theme(
point_size=4pt,
background_color="white",
key_title_font_size=12pt, key_title_color="black",
key_label_font_size=10pt, key_label_color="black",
major_label_font_size=12pt, major_label_color="black",
minor_label_font_size=10pt, minor_label_color="black"
)
Gadfly.push_theme(fonts)
# plots
set_default_plot_size(10inch, 7inch)
psnrplot = plot(
df[df[:,:transform] .!= "None", :],
y=:transform, x=:PSNR, color=:bestTH, ygroup=:method,
xintercept=df[df[:, :transform] .== "None", :PSNR],
Geom.subplot_grid(
Geom.point, Geom.vline(color=["gray"], size=[2mm]), free_y_axis=true
),
Guide.title("Peak Signal-to-Noise Ratio (PSNR)")
)
ssimplot = plot(
df[df[:,:transform] .!= "None", :],
y=:transform, x=:SSIM, color=:bestTH, ygroup=:method,
xintercept=df[df[:, :transform] .== "None", :SSIM],
Geom.subplot_grid(
Geom.point, Geom.vline(color="gray", size=[2mm]), free_y_axis=true
),
Guide.title("Structural Similarity Index Measure (SSIM)"))
# stack plots
result = gridstack([psnrplot ssimplot])
# add title
result = vstack(
compose(
context(0, 0, 1, 0.04),
(context(0, 0, 1, 1), text(0.5, 1.0, main, hcenter, vbottom), Compose.fontsize(20pt), fill("black")),
(context(), rectangle(), fill(colorant"white"))
), # title
compose(context(0, 0, 1, 0.96), result)) # plots
return result
end
blocksplot = makeplot(blocks, "Blocks")
bumpsplot = makeplot(bumps, "Bumps")
heavisineplot = makeplot(heavisine, "Heavisine")
dopplerplot = makeplot(doppler, "Doppler")
quadchirpplot = makeplot(quadchirp, "Quadchirp")
mishmashplot = makeplot(mishmash, "Mishmash")
draw(SVG("./figures/blocks.svg", 10inch, 7inch), blocksplot)
draw(SVG("./figures/bumps.svg", 10inch, 7inch), bumpsplot)
draw(SVG("./figures/heavisine.svg", 10inch, 7inch), heavisineplot)
draw(SVG("./figures/doppler.svg", 10inch, 7inch), dopplerplot)
draw(SVG("./figures/quadchirp.svg", 10inch, 7inch), quadchirpplot)
draw(SVG("./figures/mishmash.svg", 10inch, 7inch), mishmashplot)