###前提・実現したいこと
同一グラフでの静止とアニメーションの付加。(2次元グラフ、3次元散布図)
###発生している問題・エラーメッセージ
やり方が分からない
###該当のソースコード
from matplotlib import pyplot from mpl_toolkits.mplot3d import Axes3D import numpy as np from scipy import genfromtxt # データ読み込み d = genfromtxt("aiueo.csv", delimiter=",") fig = pyplot.figure(figsize=(24,24)) # 3次元散布図 ax = fig.add_subplot(121, projection='3d') ax.set_xlabel("X-axis") ax.set_ylabel("Y-axis") ax.set_zlabel("Z-axis") ax.set_xlim(-30, 30) ax.set_ylim(-40, 20) ax.set_zlim(100, 200) ax.plot(d[:,3], d[:,4], d[:,5], "o", color="g", ms=16, mew=0.5) ax.plot(d[:,0], d[:,1], d[:,2], "*", color="r", ms=16, mew=0.5) # 2次元グラフ1枚目 ax = fig.add_subplot(222) ax.set_xlabel('x-axis') ax.set_ylabel('y-axis') ax.set_xlim(-30, 30) ax.set_ylim(-20, 20) ax.plot(d[:,3], d[:,4], "o", color="g", ms=24, mew=0.5) ax.plot(d[:,0], d[:,1], "*", color="r", ms=24, mew=0.5) ax.grid(True) # 2次元グラフ2枚目 ax = fig.add_subplot(224) ax.set_xlabel('z-axis') ax.set_ylabel('y-axis') ax.set_xlim(100, 200) ax.set_ylim(-20,20) ax.plot(d[:,5], d[:,4], "o", color="g", ms=24, mew=0.5) ax.plot(d[:,2], d[:,1], "*", color="r", ms=24, mew=0.5) ax.grid(True) fig.show() pyplot.show()
ax.plot(d[:,0], d[:,1], d[:,2], "*", color="r", ms=16, mew=0.5)
ax.plot(d[:,2], d[:,1], "*", color="r", ms=24, mew=0.5)
ax.plot(d[:,2], d[:,1], "*", color="r", ms=24, mew=0.5)
上記コード内のこの3つのプロットにのみアニメーションを付加したい
###試したこと
過去のアニメーションに関する質問を軸に考えたがわからなかった。
###補足情報(言語/FW/ツール等のバージョンなど)
windows10
python2.7
matplotlib
spyder
読み込んでるCSVファイルはただの数字です。(6行)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/14 05:53