show_area#

show_area(env, area, show_altitude=False, figsize=None)[source]#

Show details for one area.

Visualize altitude, objects, and blocks within one area. Grid color indicates state altitude. Blocked states will be marked with black cross. Objects are shown in red dots.

Parameters:
  • env (environment object) – NeuGym environment object.

  • area (int or str) – Index or name of the area to show.

  • show_altitude (bool (default: False)) – Whether to show state altitude value.

  • figsize (tuple of ints (optional, default=None)) – Size of the figure.

Examples

>>> W = GridWorld()
>>> W.add_area((3, 5), name='slope')
>>> W.add_path((0, 0, 0), (1, 0, 0))
>>> W.set_altitude(1, np.random.randn(3, 5))
>>> W.block((1, 2, 4))
>>> W.add_object((1, 2, 4), 0.5, 1)
>>> W.add_object((1, 0, 3), 0.5, 1)
>>> ng.show_area(W, 1, show_altitude=True)