2

I created a 64x64 random 2D array in Julia, and then interpolated it using Interpolations.jl:

using Interpolations
using Plots
gr()
x = range(-10., length=64, stop=10.)
y = range(-10., length=64, stop=10.)

v_unscaled = interpolate(potential, BSpline(Cubic(Line(OnCell()))))
v_scaled = Interpolations.scale(v_unscaled, x, y)
v = extrapolate(v_scaled, 0) 

p_int = contour(x, y, v_scaled, fill=true)
display(p_int)

p = contour(x, y, v, fill=true)
display(p)

When I plot the extrapolated function v, the non-zero part of the contour is shrunk to the lower left corner which is not as expected, because in the specified domain, the two plots should look the same. What is wrong with the procedures above?

plot

Sato
  • 1,013
  • 1
  • 12
  • 27

0 Answers0