From bdb533690df8fc2b9e3457d6afe80e80829782a7 Mon Sep 17 00:00:00 2001 From: Peter Corke Date: Thu, 15 Oct 2026 16:25:15 +1000 Subject: [PATCH] chore: use the argument names of RTB 1.4.5 in the chapter 5 and 6 figure scripts Needs RTB 1.4.5: goal_style, path_style, edge_style, vertex_style, ellipse_style, text_opt/labels and the optimize/plot_map style arguments. colorbar=dict(shrink=1.2) (fig5_12) and inflated=True (fig5_16) were silently ignored by RTB 1.4.4 and are an error in 1.4.5, so they are dropped; the figures are unchanged by that. Co-Authored-By: Claude Sonnet 5.5 --- figures/code/chapter5/fig5_12.py | 4 ++-- figures/code/chapter5/fig5_16.py | 2 +- figures/code/chapter5/fig5_19.py | 4 ++-- figures/code/chapter5/fig5_20.py | 2 +- figures/code/chapter6/fig6_11.py | 2 +- figures/code/chapter6/fig6_13.py | 2 +- figures/code/chapter6/fig6_17.py | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/figures/code/chapter5/fig5_12.py b/figures/code/chapter5/fig5_12.py index 7daffcf..6a8585c 100755 --- a/figures/code/chapter5/fig5_12.py +++ b/figures/code/chapter5/fig5_12.py @@ -22,7 +22,7 @@ floorplan[2,1] = 0 dx = DistanceTransformPlanner(occgrid=floorplan, metric='euclidean') dx.plan((1,2)) -dx.plot(goal_marker=goalmarker,colorbar=dict(shrink=1.2)) +dx.plot(goal_style=goalmarker) ax = plt.gca() ax.grid(False) for i in range(floorplan.shape[0]): @@ -39,7 +39,7 @@ dx = DistanceTransformPlanner(occgrid=floorplan, metric='manhattan') dx.plan((1,2)) -dx.plot(goal_marker=goalmarker) +dx.plot(goal_style=goalmarker) ax = plt.gca() ax.grid(False) for i in range(floorplan.shape[0]): diff --git a/figures/code/chapter5/fig5_16.py b/figures/code/chapter5/fig5_16.py index 081a6fb..7f285fa 100755 --- a/figures/code/chapter5/fig5_16.py +++ b/figures/code/chapter5/fig5_16.py @@ -14,7 +14,7 @@ dx.plan(places.kitchen) p = dx.query(places.br3) -dx.plot(p, inflated=True, path_marker=pmarker) +dx.plot(p, path_style=pmarker) rvcprint.rvcprint() # plt.clf() diff --git a/figures/code/chapter5/fig5_19.py b/figures/code/chapter5/fig5_19.py index f3977a0..2957ab1 100755 --- a/figures/code/chapter5/fig5_19.py +++ b/figures/code/chapter5/fig5_19.py @@ -13,7 +13,7 @@ prm = PRMPlanner(occgrid=floorplan, seed=0) prm.plan(npoints=50) -prm.plot(edge=dict(alpha=0.3), vertex=dict(alpha=0.3)) +prm.plot(edge_style=dict(alpha=0.3), vertex_style=dict(alpha=0.3)) print(prm) rvcprint.rvcprint(subfig='a', thicken=None) @@ -23,7 +23,7 @@ # reseed the PRN to get a workable solution # prm = PRMPlanner(occgrid=floorplan, seed=2) prm.plan(npoints=300) -prm.plot(edge=dict(alpha=0.1), vertex=dict(alpha=0.1)) +prm.plot(edge_style=dict(alpha=0.1), vertex_style=dict(alpha=0.1)) print(prm) rvcprint.rvcprint(subfig='b', thicken=None) diff --git a/figures/code/chapter5/fig5_20.py b/figures/code/chapter5/fig5_20.py index 0523c81..05aa02a 100755 --- a/figures/code/chapter5/fig5_20.py +++ b/figures/code/chapter5/fig5_20.py @@ -27,7 +27,7 @@ striped_line = (dict(color='k', linewidth=3, zorder=21), dict(color='yellow', linewidth=2, dashes=(4,4), zorder=21)) -prm.plot(path, edge=dict(alpha=0.1), vertex=dict(alpha=0.1), path_marker=striped_line) +prm.plot(path, edge_style=dict(alpha=0.1), vertex_style=dict(alpha=0.1), path_style=striped_line) rvcprint.rvcprint(subfig='a', thicken=None) diff --git a/figures/code/chapter6/fig6_11.py b/figures/code/chapter6/fig6_11.py index 07b3d79..b9fb5b6 100755 --- a/figures/code/chapter6/fig6_11.py +++ b/figures/code/chapter6/fig6_11.py @@ -26,7 +26,7 @@ print(ekf.landmark(8)) -ekf.plot_map(ellipse=dict(filled=False, color='g')) +ekf.plot_map(ellipse_style=dict(filled=False, color='g')) veh.plot_xy('b', label='true path') plt.legend() rvcprint.rvcprint(subfig='a') diff --git a/figures/code/chapter6/fig6_13.py b/figures/code/chapter6/fig6_13.py index fa81545..5511755 100755 --- a/figures/code/chapter6/fig6_13.py +++ b/figures/code/chapter6/fig6_13.py @@ -96,7 +96,7 @@ def align2d(source, target): plt.clf() ekf.plot_xy(color='r', label='estimated path') -ekf.plot_map(confidence=0.99, ellipse=dict(filled=False, color='g')) +ekf.plot_map(confidence=0.99, ellipse_style=dict(filled=False, color='g')) v.plot(ekf._x0, facecolor='none', edgecolor='k') # plt.legend(loc='lower right') diff --git a/figures/code/chapter6/fig6_17.py b/figures/code/chapter6/fig6_17.py index 79ef6a9..6430d5e 100755 --- a/figures/code/chapter6/fig6_17.py +++ b/figures/code/chapter6/fig6_17.py @@ -8,10 +8,10 @@ pg = PoseGraph('data/pg1.g2o') print(pg.graph) pg.optimize(animate=True, retain=True, - eopt=dict(linewidth=0.5), vopt=dict(markersize=4), text=False) + edge_style=dict(linewidth=0.5), vertex_style=dict(markersize=4), labels=False) # pg.graph.plot(colorcomponents=False, edge=dict(linewidth=2, color='black'), text=dict(fontsize=12)) -pg.plot(eopt=dict(color='none'), vopt=dict(color='none'), text=dict(fontsize=12)) +pg.plot(edge_style=dict(color='none'), vertex_style=dict(color='none'), text_opt=dict(fontsize=12)) plt.xlabel('x') plt.ylabel('y')