kdeplotで火を作る
plot.py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import seaborn as sns
fig=plt.figure()
ax=fig.add_subplot()
a=np.random.normal(0,0.1,100000)
b=np.random.chisquare(2,100000)
s=0
def plot(data):
global ax,s
ax.clear()
ax.set_xlim(-1, 1)
ax.set_ylim(0, 8)
ax=sns.kdeplot(a[s:s+1000],b[s:s+1000],bw=0.1,shade=True,n_levels=30,shade_lowest=False,cmap='hot',vmin=-0.5)
s+=100
print("\b"*10,(s*100)/10000-1,"%",end="")
ani = animation.FuncAnimation(fig, plot, interval=100, frames=100)
ani.save("plot.gif", writer="imagemagick")
Author And Source
この問題について(kdeplotで火を作る), 我々は、より多くの情報をここで見つけました https://qiita.com/graph_gorilla/items/efb8cb1c1f258c91e1ff著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .