def _plotCovarianceEllipse(self, eta2):
from matplotlib.patches import Ellipse
lambda_, _ = np.linalg.eig(self.kalmanFilter.S)
ell = Ellipse(xy=(self.kalmanFilter.x_bar[0], self.kalmanFilter.x_bar[1]),
width=np.sqrt(lambda_[0]) * np.sqrt(eta2) * 2,
height=np.sqrt(lambda_[1]) * np.sqrt(eta2) * 2,
angle=np.rad2deg(np.arctan2(lambda_[1], lambda_[0])),
linewidth=2,
)
ell.set_facecolor('none')
ell.set_linestyle("dotted")
ell.set_alpha(0.5)
ax = plt.subplot(111)
ax.add_artist(ell)
评论列表
文章目录