(guebin) Bunny (2)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from pygsp import graphs, filters, plotting, utils
import plotly.express as px
from IPython.display import HTML
G = graphs.Bunny()
n = G.N
g = filters.Heat(G, tau=80) # 꼬리부분의 빨간신호를 퍼지게하는 정도
normal = np.random.randn(n)*0.3
unif = np.concatenate([np.random.rand(63)*3, np.zeros(n-63)]); np.random.shuffle(unif)
noise = normal + unif
plt.plot(noise); plt.plot(unif)
f = np.zeros(n)
f[1000] = 3234
f = g.filter(f, method='chebyshev')
plt.plot(f)
W = G.W.toarray()
x = G.coords[:,0]
y = G.coords[:,1]
z = G.coords[:,2]
# color=f,
# opacity=0.7,
# height=400,
# size=abs(f+noise),
# range_color=[-1,5],
# color_continuous_scale='jet')
# fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))
# fig.update_traces(marker=dict(line=dict(width=0)))
# HTML(fig.to_html(include_mathjax=False, config=dict({'scrollZoom':False})))
# color=f+noise,
# opacity=1,
# height=400,
# size=abs(f+noise),
# range_color=[-1,5],
# color_continuous_scale='jet')
# fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))
# fig.update_traces(marker=dict(line=dict(width=0)))
# HTML(fig.to_html(include_mathjax=False, config=dict({'scrollZoom':False})))