Altered colors of plots.

Maybe not perfect yet, but I have signicantly changed the colors
and various other look-and-fell aspects of the plots.
This commit is contained in:
Roger Labbe 2014-08-31 22:07:01 -07:00
parent 02a4b477e1
commit 9f3c2c0fa7
14 changed files with 714 additions and 520 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

79
Untitled0.ipynb Normal file

File diff suppressed because one or more lines are too long

View File

@ -6,18 +6,16 @@ def load_style():
styles = open("./styles/custom2.css", "r").read()
return HTML(styles)
pylab.rcParams['axes.color_cycle'] = '348ABD, 7A68A6, A60628, 467821, CF4457, 188487, E24A33'
pylab.rcParams['lines.linewidth'] = 1
pylab.rcParams['lines.linewidth'] = 2
pylab.rcParams['lines.antialiased'] = True
pylab.rcParams['patch.linewidth'] = 0.5
pylab.rcParams['patch.facecolor'] = '348ABD' #blue
pylab.rcParams['patch.edgecolor'] = 'eeeeee'
pylab.rcParams['patch.antialiased'] = True
pylab.rcParams['font.family'] = 'monospace'
pylab.rcParams['font.size'] = 10.0
pylab.rcParams['font.size'] = 12.0
#pylab.rcParams['font.monospace'] = 'Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace'
pylab.rcParams['axes.facecolor'] = 'eeeeee'
pylab.rcParams['axes.facecolor'] = 'E5E5E5'
pylab.rcParams['axes.edgecolor'] = 'bcbcbc'
pylab.rcParams['axes.linewidth'] = 1
pylab.rcParams['axes.grid'] = True
@ -25,7 +23,7 @@ pylab.rcParams['axes.titlesize'] = 'x-large'
pylab.rcParams['axes.labelsize'] = 'large'
pylab.rcParams['axes.labelcolor'] = '555555'
pylab.rcParams['axes.axisbelow'] = True
pylab.rcParams['axes.color_cycle'] = '348ABD, 7A68A6, A60628, 467821, CF4457, 188487, E24A33'
pylab.rcParams['axes.color_cycle'] = '004080, 8EBA42, E24A33, 348ABD, 777760, 988ED5, FDC15E'
pylab.rcParams['xtick.major.pad'] = 6
pylab.rcParams['xtick.minor.size'] = 0
pylab.rcParams['xtick.minor.pad'] = 6
@ -36,4 +34,8 @@ pylab.rcParams['figure.facecolor'] = '0.85'
pylab.rcParams['figure.edgecolor'] = '0.50'
pylab.rcParams['figure.subplot.hspace'] = 0.5
pylab.rcParams['figure.figsize'] = 12,6
pylab.rcParams['grid.color'] = 'ffffff'
pylab.rcParams['grid.linestyle'] = 'solid'
pylab.rcParams['grid.linewidth'] = 1.5

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -20,16 +20,19 @@ def show_residual_chart():
plt.scatter ([2],[2.8],marker='o')
ax = plt.axes()
ax.annotate('', xy=(2,3), xytext=(1,2),
arrowprops=dict(arrowstyle='->', ec='b',shrinkA=3, shrinkB=4))
ax.annotate('prediction', xy=(2.04,3.), color='b')
arrowprops=dict(arrowstyle='->', ec='#004080',
lw=2,
shrinkA=3, shrinkB=4))
ax.annotate('prediction', xy=(2.04,3.), color='#004080')
ax.annotate('measurement', xy=(2.05, 2.28))
ax.annotate('prior estimate', xy=(1, 1.9))
ax.annotate('residual', xy=(2.04,2.6), color='r')
ax.annotate('residual', xy=(2.04,2.6), color='#e24a33')
ax.annotate('new estimate', xy=(2,2.8),xytext=(2.1,2.8),
arrowprops=dict(arrowstyle='->', ec="k", shrinkA=3, shrinkB=4))
ax.annotate('', xy=(2,3), xytext=(2,2.3),
arrowprops=dict(arrowstyle="-",
ec="r",
ec="#e24a33",
lw=2,
shrinkA=5, shrinkB=5))
plt.title("Kalman Filter Prediction Update Step")
plt.axis('equal')
@ -39,7 +42,7 @@ def show_residual_chart():
def show_position_chart():
""" Displays 3 measurements at t=1,2,3, with x=1,2,3"""
plt.scatter ([1,2,3], [1,2,3], s=128)
plt.scatter ([1,2,3], [1,2,3], s=128, color='#004080')
plt.xlim([0,4]);
plt.ylim([0,4])
@ -54,7 +57,7 @@ def show_position_chart():
def show_position_prediction_chart():
""" displays 3 measurements, with the next position predicted"""
plt.scatter ([1,2,3], [1,2,3], s=128)
plt.scatter ([1,2,3], [1,2,3], s=128, color='#004080')
plt.xlim([0,5])
plt.ylim([0,5])
@ -65,7 +68,7 @@ def show_position_prediction_chart():
plt.xticks(np.arange(1,5,1))
plt.yticks(np.arange(1,5,1))
plt.scatter ([4], [4], c='g',s=128)
plt.scatter ([4], [4], c='g',s=128, color='#8EBA42')
ax = plt.axes()
ax.annotate('', xy=(4,4), xytext=(3,3),
arrowprops=dict(arrowstyle='->',
@ -181,6 +184,6 @@ def plot_3d_covariance(mean, cov):
if __name__ == "__main__":
plot_3d_covariance((2,7), np.array([[8.,0],[0,4.]]))
#show_residual_chart()
#show_position_chart()
#plot_3d_covariance((2,7), np.array([[8.,0],[0,4.]]))
show_residual_chart()

View File

@ -226,7 +226,7 @@ def is_inside_ellipse(x,y, ex, ey, orientation, width, height):
def plot_covariance_ellipse(mean, cov=None, variance = 1.0,
ellipse=None, title=None, axis_equal=True,
facecolor='none', edgecolor='blue'):
facecolor='none', edgecolor='#004080'):
""" plots the covariance ellipse where
mean is a (x,y) tuple for the mean of the covariance (center of ellipse)
@ -273,7 +273,7 @@ def plot_covariance_ellipse(mean, cov=None, variance = 1.0,
e = Ellipse(xy=mean, width=sd*width, height=sd*height, angle=angle,
facecolor=facecolor,
edgecolor=edgecolor,
lw=1)
lw=2)
ax.add_patch(e)
plt.scatter(mean[0], mean[1], marker='+') # mark the center
@ -330,7 +330,7 @@ if __name__ == '__main__':
do_plot_test()
test_gaussian()
#test_gaussian()
# test conversion of scalar to covariance matrix
x = multivariate_gaussian(np.array([1,1]), np.array([3,4]), np.eye(2)*1.4)