Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdf/examples/interp_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

figure, axes = plt.subplots(len(methods), sharex=True)

figure.canvas.set_window_title('Inter- and Extrapolation Methods')
figure.canvas.manager.set_window_title('Inter- and Extrapolation Methods')
figure.set_facecolor('white')

for ax, method in zip(axes, methods):
yi = table.evaluate((xi,), interp=method[0], extrap=method[1])
dyi = table.evaluate_derivative((xi,), (dxi,), interp=method[0], extrap=method[1])
ax.set_title("interp='%s', extrap='%s'" % method)
ax.grid(b=True, which='both', color='0.9', linestyle='-', zorder=0)
ax.grid(visible=True, which='both', color='0.9', linestyle='-', zorder=0)
ax.plot(x, y, 'or', label='samples', zorder=300)
ax.plot(xi, yi, 'b', label='interpolated', zorder=100)
ax.plot(xi, dyi, 'r', label='derivative', zorder=100)
Expand Down
6 changes: 3 additions & 3 deletions sdf/examples/interp_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def peaks(x=np.linspace(-3, 3, 49), y=np.linspace(-3, 3, 49)):
XI, YI = np.meshgrid(xi, yi, indexing='ij')

figure, axes = plt.subplots(ncols=2, nrows=2, sharex=True, sharey=True)
figure.canvas.set_window_title('Inter- & Extrapolation Methods')
figure.canvas.manager.set_window_title('Inter- & Extrapolation Methods')
figure.set_facecolor('white')

axes = axes.flatten()
Expand All @@ -31,7 +31,7 @@ def peaks(x=np.linspace(-3, 3, 49), y=np.linspace(-3, 3, 49)):
im = NonUniformImage(ax)
im.set_data(x, y, Z)
im.set_extent((-3, 3, -3, 3))
ax.images.append(im)
ax.add_image(im)
ax.set_xlim([-6, 6])
ax.set_ylim([-6, 6])

Expand All @@ -43,7 +43,7 @@ def peaks(x=np.linspace(-3, 3, 49), y=np.linspace(-3, 3, 49)):
im = NonUniformImage(ax)
im.set_data(xi, yi, ZI)
im.set_extent((-6, 6, -6, 6))
ax.images.append(im)
ax.add_image(im)

figure.tight_layout()
plt.show()
4 changes: 2 additions & 2 deletions sdf/examples/spline_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

figure, axes = plt.subplots(len(methods), sharex=True)

figure.canvas.set_window_title('Spline based interpolation methods')
figure.canvas.manager.set_window_title('Spline based interpolation methods')
figure.set_facecolor('white')

for ax, method in zip(axes, methods):
yi = table.evaluate((xi,), interp=method, extrap='linear')
dyi = table.evaluate_derivative((xi,), (dxi,), interp=method, extrap='linear')
ax.set_title(method)
ax.grid(b=True, which='both', color='0.9', linestyle='-', zorder=0)
ax.grid(visible=True, which='both', color='0.9', linestyle='-', zorder=0)
ax.plot(x, y, 'or', label='samples', zorder=300)
ax.plot(xi, yi, 'b', label='interpolated', zorder=100)
ax.plot(xi, dyi, 'r', label='derivative', zorder=100)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ def readme():
'linux64/libndtable.so',
'darwin64/libNDTable.dylib']},
platforms=['darwin64', 'linux64', 'win32', 'win64'],
install_requires=['numpy', 'h5py', 'matplotlib', 'scipy'])
install_requires=['numpy', 'h5py', 'matplotlib>=3.6', 'scipy'])