Skip to content

画图怎么画呢 老提示matplotlib does not support generators as input#50

Open
potatoper wants to merge 1 commit intohanbt:masterfrom
Danielyan86:master
Open

画图怎么画呢 老提示matplotlib does not support generators as input#50
potatoper wants to merge 1 commit intohanbt:masterfrom
Danielyan86:master

Conversation

@potatoper
Copy link
Copy Markdown

def plot(linear_unit):
import matplotlib.pyplot as plt
input_vecs, labels = get_training_dataset()
fig = plt.figure()
ax = fig.add_subplot(111)
ax.scatter(map(lambda x: x[0], input_vecs), labels)
weights = linear_unit.weights
bias = linear_unit.bias
x = range(0,12,1)
y = map(lambda x:weights[0] * x + bias, x)
ax.plot(x, y)
plt.show()

@potatoper potatoper closed this Jul 18, 2019
@potatoper potatoper reopened this Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants