Skip to content

Commit

Permalink
Add title arg (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: jparisu <[email protected]>
  • Loading branch information
jparisu authored Feb 1, 2024
1 parent 8e70272 commit cfbae56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/sIArena/terrain/plot/plot_2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ def plot_terrain_2D(
terrain: Terrain,
paths: List[Path] = [],
colors: List[str] = ['r', 'y', 'm', 'k', 'c', 'g', 'b'],
cmap: str = 'terrain'):
cmap: str = 'terrain',
title: str = 'Terrain',
):
"""Plots the terrain and the given paths"""

plt.clf()
Expand All @@ -27,6 +29,7 @@ def plot_terrain_2D(

plt.xlabel('row')
plt.ylabel('col')
plt.title(title)

plt.colorbar()
plt.show(block=False)
Expand Down
5 changes: 4 additions & 1 deletion src/sIArena/terrain/plot/plot_3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def plot_terrain_3D(
angles: List[tuple] = [(45, 45), (45, 225)],
paths: List[Path] = [],
colors: List[str] = ['r', 'y', 'm', 'k', 'c', 'g', 'b'],
cmap: str = 'terrain'):
cmap: str = 'terrain',
title: str = 'Terrain',
):
"""Plots the terrain and the given paths"""

fig = plt.figure(figsize=(18, 6))
Expand Down Expand Up @@ -56,4 +58,5 @@ def plot_terrain_3D(
ax.set_xlabel('row')
ax.set_ylabel('col')

fig.title(title)
plt.show()

0 comments on commit cfbae56

Please sign in to comment.