Skip to content

Commit f7fc3f0

Browse files
committed
fix: Update grid size and z-axis limits in periodic spline example
Signed-off-by: Sietze van Buuren <s.van.buuren@gmail.com>
1 parent 8eb1603 commit f7fc3f0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

cubinterpp/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ def main():
132132
'data points'
133133
)
134134

135+
x, y, f = get_test_data_2d(case='three_bumps')
136+
xp = np.repeat(x, y.size)
137+
yp = np.tile(y, x.size)
138+
zp = f.flatten()
139+
135140
for interp_type in ('linear', 'monotonic', 'akima', 'natural_spline'):
136141
x_fine, y_fine, z_fine = cubinterpp_interp2(
137142
interp_type=interp_type,
@@ -146,10 +151,6 @@ def main():
146151
ax.xticks = 8
147152
ax.yticks = 8
148153
ax.zlim = [0, 8]
149-
x, y, f = get_test_data_2d(case='three_bumps')
150-
xp = np.repeat(x, y.size)
151-
yp = np.tile(y, x.size)
152-
zp = f.flatten()
153154
mpg.points3(xp, yp, zp, color=(0.8, 0.1, 0.1, 1), size=3)
154155

155156
x, y, f = get_test_data_2d(case='three_bumps')

cubinterpp/periodic_spline_2d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def main():
3131
spline_y = cubinterpp.NaturalPeriodicSpline2D(tx, ty, y)
3232
spline_z = cubinterpp.NaturalPeriodicSpline2D(tx, ty, z)
3333
# evaluate on finer grid
34-
nxi, nyi = 30, 30
34+
nxi, nyi = 33, 33
3535
txi = np.linspace(0.0, 1.0, nxi)
3636
tyi = np.linspace(0.0, 1.0, nyi)
3737
x_fine = np.zeros((nxi, nyi))
@@ -50,7 +50,7 @@ def main():
5050
ax.azimuth = 225
5151
ax.xlim = [-4, 4]
5252
ax.ylim = [-4, 4]
53-
ax.zlim = [-1.5, 1.5]
53+
ax.zlim = [-2.5, 2.5]
5454
xp = x.flatten()
5555
yp = y.flatten()
5656
zp = z.flatten()

0 commit comments

Comments
 (0)