Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
96129 views
1
# -*- coding: utf-8 -*-
2
"""
3
Created on Thu Jul 9 13:02:32 2015
4
5
@author: Roger Labbe
6
"""
7
8
import filterpy.stats as stats
9
import matplotlib.pyplot as plt
10
from matplotlib.patches import Ellipse
11
import numpy as np
12
13
14
def plot1():
15
16
stats.plot_covariance_ellipse((10, 2), P, facecolor='g', alpha=0.2)
17
18
19
def plot2():
20
P = np.array([[6, 2.5], [2.5, .6]])
21
circle1=plt.Circle((10,0),3,color='#004080',fill=False,linewidth=4, alpha=.7)
22
ax = plt.gca()
23
ax.add_artist(circle1)
24
plt.xlim(0,10)
25
plt.ylim(0,3)
26
P = np.array([[6, 2.5], [2.5, .6]])
27
stats.plot_covariance_ellipse((10, 2), P, facecolor='g', alpha=0.2)
28
29
def plot3():
30
P = np.array([[6, 2.5], [2.5, .6]])
31
circle1=plt.Circle((10,0),3,color='#004080',fill=False,linewidth=4, alpha=.7)
32
ax = plt.gca()
33
ax.add_artist(circle1)
34
plt.xlim(0,10)
35
plt.ylim(0,3)
36
plt.axhline(3, ls='--')
37
stats.plot_covariance_ellipse((10, 2), P, facecolor='g', alpha=0.2)
38
39
def plot4():
40
P = np.array([[6, 2.5], [2.5, .6]])
41
circle1=plt.Circle((10,0),3,color='#004080',fill=False,linewidth=4, alpha=.7)
42
ax = plt.gca()
43
ax.add_artist(circle1)
44
plt.xlim(0,10)
45
plt.ylim(0,3)
46
plt.axhline(3, ls='--')
47
stats.plot_covariance_ellipse((10, 2), P, facecolor='g', alpha=0.2)
48
plt.scatter([11.4], [2.65],s=200)
49
plt.scatter([12], [3], c='r', s=200)
50
plt.show()
51