Rotating 3D t-SNE animated gif scatterplot with matplotlib mahler83, 2019-10-112023-07-19 So I’ve been through a few hours of searching + trial & error and came up with a simple solution to draw an animated GIF 3D scatterplot.(minimum library installs, exclude bash commands) X = data.iloc[:,0:-1] Y = data.iloc[:,-1].astype('int') from sklearn.manifold import TSNE tsne = TSNE(n_components=3, random_state=RS, perplexity=10) tsne_fit = tsne.fit_transform(X) n_components should be set to 3 in order to draw a 3D plot.perpliexity should be adjusted by trial and error to find the best value that represents your data. sqrt(N) is a good starting point. from mpl_toolkits.mplot3d import Axes3D from matplotlib import animation fig = plt.figure(figsize=(10,10)) ax = Axes3D(fig) colors = 'b', 'r' labels = 'Group1', 'Group2' for i, c, label in zip(range(len(labels)), colors, labels): ax.scatter(tsne_fit[data['Group']==i, 0], tsne_fit[data['Group']==i, 1], tsne_fit[data['Group']==i, 2], s=30, c=c, label=label, alpha=0.5) fig.legend() Axes3D is for 3D plotting.matplotlib.animation is for making animated GIF. Draw the scatterplot. In my case, I used scatter() twice to label the outcome feature.Added alpha=0.5 for better visualization when datapoints overlap. def rotate(angle): ax.view_init(azim=angle) angle = 3 ani = animation.FuncAnimation(fig, rotate, frames=np.arange(0, 360, angle), interval=50) ani.save('inhadr_tsne1.gif', writer=animation.PillowWriter(fps=20)) Build an arbitrary function rotate() that updates the view of the plot. This function will be called by FuncAnimation().The writer is set to PillowWriter since it’s included by default in matplotlib. But while searching, I found that in some cases there are some problems in the animation, and can be solved by using a different writer, such as FFMpegWriter.angle=3 means the plot rotates 3 degrees every frame. (120 frames in total)interval=50, fps=20 values can be tweaked to change the rotation speed of animation. bingle bangle~ Took 10 seconds to draw this.대만족! This is definitely going to be put in my next presentation! Share this:FacebookX IT Lab Stuff Tips & Techs
삼성 Kies 2.0 다운로드 링크 2012-05-302023-07-19 구글링해도 자꾸 엉뚱한 곳으로 연결되거나 깨진 링크가 많아서… http://www.samsung.com/sec/sppt/pcApplication.do 여기서 다운로드 받을 수 있다. 아내의 갤럭시S 업그레이드용 Share this:FacebookX Read More
DVI 케이블 종류 2013-03-222023-07-19 DVI는 Digital Visual Interface의 약자로 기존에 아날로그 신호를 받아 표시하던 CRT 모니터와 달리 LCD나 LED 모니터에서는 디지털 신호를 컴퓨터로부터 직접 받아서 영상화하는 것이 가능해지면서 개발된 전송방식이다. 즉, LCD 모니터에 D-SUB 케이블 (사다리꼴 모양 단자의 케이블)을 사용하면 컴퓨터에서 Digital 신호를 그래픽카드에서 Analog로 변환 → 케이블을 타고 전송되면서 약간의 화질 열화 →… Share this:FacebookX Read More
Gaming 포켓몬고 플러스 리뷰 2017-03-09 어릴때 닌텐도 게임보이 에뮬레이터로 Pokemon Blue를 너무나 즐겁게 플레이한 추억이 있어 Pokemon GO도 자연스럽게 하게 되었고, 악세사리인 Pokemon GO Plus도 구매하게 되었다. (직장인이 되어 돈을 버니까 부모님 눈치를 안 보고 돈을 쓸 수 있으니까 좋네요) 10일 정도 사용해보면서 느낀 점들을 정리해본다. 조작법 1. 설정하기 설정에 들어가 Pokemon GO Plus를 누르면… Share this:FacebookX Read More
Sorry, I’ve never tried annotation. Does this help? https://stackoverflow.com/questions/56293154/axes3d-text-annotate-3d-scatter-plot