Spaces:
Runtime error
Runtime error
File size: 997 Bytes
317f6c1 4e6ebd6 3b85727 4e6ebd6 3b85727 4e6ebd6 317f6c1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | # import gym
# from IPython import display
# import matplotlib.pyplot as plt
# # %matplotlib inline
# env = gym.make('Breakout-v0')
# env.reset()
# for _ in range(100):
# plt.imshow(env.render(mode='rgb_array'))
# display.display(plt.gcf())
# display.clear_output(wait=True)
# action = env.action_space.sample()
# env.step(action)
import streamlit as st
import numpy as np
import matplotlib.pyplot as plt
import time
import gym
# env = gym.make('CartPole-v1')
# obs = env.reset()
# while True:
# action = env.action_space.sample()
# obs, reward, done, info = env.step(action)
# rgb_array = env.render(mode='rgb_array')
# plt.imshow(env.render(mode='rgb_array'))
# # use the RGB array for further processing or display
# if done:
# break
# Create plot
x = np.linspace(0, 10, 100)
y = np.cos(x)
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set_title("Cosine wave")
container = st.empty()
container.pyplot(fig)
time.sleep(10)
container.empty()
|