縦に円の並びできますが、横に並び方法を教えて頂きたいです。
python
1 2import numpy as np 3import matplotlib.pyplot as plt 4from mpl_toolkits.mplot3d import Axes3D 5 6# Figureを追加 7fig = plt.figure(figsize = (8, 8)) 8 9# 3DAxesを追加 10ax = fig.add_subplot(111, projection='3d') 11 12# 円周率の定義 13pi = np.pi 14 15# パラメータ分割数 16n = 256 17 18# パラメータtを作成 19t = np.linspace(-6*pi, 6*pi, n) 20 21# 円を作成 22for i in range (0, 5): 23# このようにしたいです。 24 x = i 25 y = np.cos(t) 26 z = np.sin(t) 27 28# 以下は出来ますが 29# x = np.cos(t) 30# y = np.sin(t) 31# z = i 32 33# 曲線を描画 34 ax.plot(x, y, z) 35 36plt.show() 37
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/10/07 22:56