From 563d21c8d39fe31156cf351bc2dbe2d5ea5c5872 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 25 May 2024 18:26:55 +0200 Subject: [PATCH 1/2] plot_spline_2d(): call plot_vertices_2d() with "ax" --- doc/euclidean/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/euclidean/helper.py b/doc/euclidean/helper.py index bbf758e..3d12cd0 100644 --- a/doc/euclidean/helper.py +++ b/doc/euclidean/helper.py @@ -86,7 +86,7 @@ def plot_spline_2d(spline, dots_per_second=15, marker='.', linestyle='', total_duration = spline.grid[-1] - spline.grid[0] dots = int(total_duration * dots_per_second) + 1 times = spline.grid[0] + _np.arange(dots) / dots_per_second - plot_vertices_2d(spline.evaluate(spline.grid), chords=chords) + plot_vertices_2d(spline.evaluate(spline.grid), chords=chords, ax=ax) ax.plot( *spline.evaluate(times).T, marker=marker, From be34912e629759adcb32d2292ad197c0a49c4d34 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 25 May 2024 18:36:44 +0200 Subject: [PATCH 2/2] De Casteljau notebook: Fix call of plot_vertices_2d() --- doc/euclidean/bezier-de-casteljau.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/euclidean/bezier-de-casteljau.ipynb b/doc/euclidean/bezier-de-casteljau.ipynb index 6b053e0..2d93b65 100644 --- a/doc/euclidean/bezier-de-casteljau.ipynb +++ b/doc/euclidean/bezier-de-casteljau.ipynb @@ -99,7 +99,7 @@ " ax = plt.gca()\n", " times = np.linspace(0, 1, dots)\n", " ax.plot(*func(points, times).T, '.')\n", - " plot_vertices_2d(points)\n", + " plot_vertices_2d(points, ax=ax)\n", " ax.set_title(func.__name__ + ' Bézier curve')\n", " ax.axis('equal')" ]