Last active
August 26, 2020 19:49
-
-
Save geyang/bfbdf245bb3f16175023c2950c092baf to your computer and use it in GitHub Desktop.
CommonMark-X Landmark Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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