matplotlibに散布図があります
import matplotib.pyplot as plt
fig, ax = plt.subplots()
scatter = ax.scatter([0], [0])
scatter.remove() # remove the scatter from figure
scatter
それを図に追加(戻す)する方法はありますか?
散乱はmatplotlib.collections.PathCollection
です。このようなコレクションを軸に追加するには、次を使用しますax.add_collection
。
ax.add_collection(scatter)
完全な例:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
scatter = ax.scatter([0], [0])
scatter.remove()
ax.add_collection(scatter)
plt.show()
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加