Spaces:
Runtime error
Runtime error
import streamlit as st | |
import numpy as np | |
import matplotlib.pyplot as plt | |
number_of_observations = st.slider('Number of observations', min_value=50, max_value=150) | |
X = np.column_stack((np.ones(number_of_observations), | |
np.random.random(number_of_observations)) | |
fig = plt.figure(dpi=80, figsize=(7,7)) | |
ax = fig.add_subplot(111) | |
ax.set_xlim((0,1)) | |
ax.set_ylim((-5,20)) | |
plt.scatter(X[:,1], y, c='r', edgecolors='#fda172') | |
line_thickness = 2 | |
line, = ax.plot([], [], lw=line_thickness) | |
st.pyplot(fig) | |
st.write(X[:5, :]) |