相关疑难解决方法(0)

在matplotlib的3d图中将箭头放在矢量上

我绘制了一些3D数据的特征向量,并想知道目前(已经)是否有办法将箭头放在线上?如果有人给我一个提示,那会很棒.在此输入图像描述

import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

####################################################
# This part is just for reference if
# you are interested where the data is
# coming from
# The plot is at the bottom
#####################################################

# Generate some example data
mu_vec1 = np.array([0,0,0])
cov_mat1 = np.array([[1,0,0],[0,1,0],[0,0,1]])
class1_sample = np.random.multivariate_normal(mu_vec1, cov_mat1, 20)

mu_vec2 = np.array([1,1,1])
cov_mat2 = np.array([[1,0,0],[0,1,0],[0,0,1]])
class2_sample = np.random.multivariate_normal(mu_vec2, cov_mat2, 20)

# concatenate data for PCA
samples = np.concatenate((class1_sample, class2_sample), axis=0) …
Run Code Online (Sandbox Code Playgroud)

python plot matplotlib

28
推荐指数
3
解决办法
2万
查看次数

标签 统计

matplotlib ×1

plot ×1

python ×1