I'm drawing a graph with matplotlib, but I can't draw a graph.

Asked 2 years ago, Updated 2 years ago, 64 views

ax1 = fig.add_subplot(2,2,1)

After creating an object called ax1 like this,

a = ax1.scatter(np.arange(30), np.arange(30)+3*randn(30))

I drew a graph like this, but unlike the bar in the book, Graph is not returned

matplotlib.collections.PathCollection at 0x1106424a8 What's the reason why it's only coming up like this

matplotlib

2022-09-22 22:04

1 Answers

I wish there was more explanation about what kind of book you were looking at and what kind of environment you were running in, but if you guess and answer them, It looks like the following situation.

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> plt.scatter(np.arange(30), np.arange(30));
<matplotlib.collections.PathCollection object at 0x1049094e0>

I can see the graph when you write it down as below.

>>> plt.show()


2022-09-22 22:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.