Skip to content

Instantly share code, notes, and snippets.

@geyang
Last active August 26, 2020 19:49
Show Gist options
  • Save geyang/bfbdf245bb3f16175023c2950c092baf to your computer and use it in GitHub Desktop.
Save geyang/bfbdf245bb3f16175023c2950c092baf to your computer and use it in GitHub Desktop.
CommonMark-X Landmark Example

Example for Rendering the Landmarks

import gym
import numpy as np
from cmx import doc
import matplotlib.pyplot as plt
doc.config("README.md")
doc @ """
# Example for Rendering the Landmarks
"""
env = gym.make("ge_world:CMaze-v0")
env.reset()
img = env.render("rgb", width=480, height=480)
plt.imshow(img, extent=[-0.3, 0.3, -0.3, 0.3])
landmarks = np.array([(0.20, -0.20), (0.2, -0.1), (0.2,0.1)])
plt.scatter(*landmarks.T, s=60, color="orange")
doc.savefig(f"./cmaze_landmark.png", dpi=300)
doc.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment