PieterjanRobbe / GaussianRandomFields.jl

A package for Gaussian random field generation in Julia
Other
66 stars 11 forks source link

Transpose 2D field sample array in plot recipe #42

Closed matt-graham closed 2 years ago

matt-graham commented 2 years ago

Fixes #41.

Transposes sampled two-dimensional Gaussian random field arrays in the two-dimensional plot recipe to match with the dimension ordering assumed by the Plots.jl API.

After the change in this PR running

using GaussianRandomFields, Random, Plots
Random.seed!(87234632804762304832)
cov = CovarianceFunction(2, Matern(1/2, 5/4))
grf = GaussianRandomField(cov, GaussianRandomFields.Cholesky(), range(0, 2, 50), range(0, 1, 25))
grfplots = [plotfunc(grf) for  plotfunc in (surface, contour, contourf, heatmap)]
plot(grfplots...)

produces the output

image

compared to the output on the current master

image