Skip to content

Commit a916c42

Browse files
committed
docs: Export zoomed example figures
Signed-off-by: Sietze van Buuren <s.van.buuren@gmail.com>
1 parent 3c0cb5a commit a916c42

File tree

10 files changed

+330
-4
lines changed

10 files changed

+330
-4
lines changed

cubinterpp/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" Compare Spline Interpolation types """
22

3+
from pathlib import Path
34
import numpy as np
45
from scipy.interpolate import RegularGridInterpolator
56
import mlpyqtgraph as mpg
@@ -152,6 +153,9 @@ def main():
152153
ax.yticks = 8
153154
ax.zlim = [0, 8]
154155
mpg.points3(xp, yp, zp, color=(0.8, 0.1, 0.1, 1), size=3)
156+
ax.distance = 115
157+
filepath = Path(__file__).parents[1] / 'docs' / 'images' / f'{interp_type}_2D.png'
158+
ax.export(str(filepath))
155159

156160
x, y, f = get_test_data_2d(case='three_bumps')
157161
x_fine, y_fine = refine_grid(x, 46), refine_grid(y, 46)

cubinterpp/periodic_spline.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" Simple test for Periodic Spline Interpolation """
22

3+
from pathlib import Path
34
import numpy as np
45
import mlpyqtgraph as mpg
56
import cubinterpp.cubinterpp_py as cubinterpp # cubinterpp_py is a pybind11 module
@@ -25,7 +26,6 @@ def test_data(case='circle'):
2526

2627
@mpg.plotter
2728
def main():
28-
2929
t, x, y = test_data('arbitrary')
3030

3131
spline_x = cubinterpp.NaturalPeriodicSpline1D(t, x)
@@ -42,7 +42,8 @@ def main():
4242
mpg.plot(x_interp_scipy, y_interp_scipy, style='--')
4343
mpg.plot(x, y, width=0, symbol='o', symbol_color='r', symbol_size=6)
4444
mpg.legend('cubinterpp', 'scipy', 'data points')
45-
mpg.gca().grid = True
45+
ax = mpg.gca()
46+
ax.grid = True
4647

4748

4849
if __name__ == '__main__':

cubinterpp/periodic_spline_2d.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" Periodic spline example in 3D """
22

3+
from pathlib import Path
34
import random
45
import numpy as np
56
import cubinterpp.cubinterpp_py as cubinterpp # cubinterpp_py is a pybind11 module
@@ -60,7 +61,9 @@ def main():
6061
yp = y.flatten()
6162
zp = z.flatten()
6263
mpg.points3(xp, yp, zp, color=(0.8, 0.1, 0.1, 1), size=5)
63-
ax.export('periodic_spline_2d.png')
64+
ax.distance = 115
65+
filepath = Path(__file__).parents[1] / 'docs' / 'images' / 'periodic_spline_2D.png'
66+
ax.export(str(filepath))
6467

6568

6669
if __name__ == '__main__':

docs/images/akima_2D.png

30.7 KB
Loading

docs/images/linear_2D.png

22.3 KB
Loading

docs/images/monotonic_2D.png

27.2 KB
Loading

docs/images/natural_spline_2D.png

38.8 KB
Loading

docs/images/periodic_spline.svg

Lines changed: 318 additions & 0 deletions
Loading

docs/images/periodic_spline_2D.png

107 KB
Loading

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ classifiers = [
2020
]
2121
urls = { Homepage = "https://github.com/swvanbuuren/cubinterpp" }
2222
dependencies = [
23-
"mlpyqtgraph==0.12.0",
23+
"mlpyqtgraph==0.13.0",
2424
"scipy==1.17.0",
2525
]
2626

0 commit comments

Comments
 (0)