Skip to content

Commit 10d443d

Browse files
committed
plotting cleanup
1 parent 242356b commit 10d443d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/gaussian-process-priors/script.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function visualize(k::Kernel)
7070
colorbar=false,
7171
ylabel=string(nameof(typeof(k))),
7272
ylim=xlim,
73-
yticks=(xlim, xlim),
73+
yticks=([xlim[1], 0, xlim[end]], ["\u22125", raw"$x'$", "5"]),
7474
vlim=(0, 1),
7575
title=raw"$k(x, x')$",
7676
aspect_ratio=:equal,
@@ -82,8 +82,8 @@ function visualize(k::Kernel)
8282
k.(X, 0.0);
8383
title=string(raw"$k(x, x_\mathrm{ref})$"),
8484
label=raw"$x_\mathrm{ref}=0.0$",
85-
xlim=xlim,
86-
xticks=(xlim, xlim),
85+
legend=:topleft,
86+
foreground_color_legend=nothing,
8787
)
8888
plot!(X, k.(X, 1.5); label=raw"$x_\mathrm{ref}=1.5$")
8989

@@ -96,15 +96,15 @@ function visualize(k::Kernel)
9696
layout=(1, 3),
9797
xlabel=raw"$x$",
9898
xlim=xlim,
99-
xticks=(xlim, xlim),
99+
xticks=collect(xlim),
100100
)
101101
end;
102102

103103
##
104104
# We can now visualize a kernel and show samples from
105105
# a Gaussian process with a given kernel:
106106

107-
plot(visualize(SqExponentialKernel()); size=(600, 220))
107+
plot(visualize(SqExponentialKernel()); size=(800, 210), bottommargin=5mm, topmargin=5mm)
108108

109109
##
110110
# ## Kernel comparison
@@ -118,7 +118,7 @@ kernels = [
118118
WhiteKernel(),
119119
ConstantKernel(),
120120
LinearKernel(),
121-
PeriodicKernel(),
121+
compose(PeriodicKernel(), ScaleTransform(0.2)),
122122
NeuralNetworkKernel(),
123123
]
124124
plot(

0 commit comments

Comments
 (0)