def plot(self, ax):
"""Plot a two-dimensional environment.
Parameters
----------
ax : Axis
Matplotlib axis
"""
if self.n_task_dims != 2:
raise ValueError("Can only plot 2 dimensional environments")
ax.scatter(self.x0[0], self.x0[1], c="r", s=100)
ax.scatter(self.g[0], self.g[1], c="g", s=100)
if self.obstacles is not None:
from matplotlib.patches import Circle
for obstacle in self.obstacles:
ax.add_patch(Circle(obstacle, self.obstacle_dist, ec="none",
color="r"))
评论列表
文章目录