CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download
Project: test
Views: 91872
1
# -*- coding: utf-8 -*-
2
"""
3
Created on Tue May 27 21:21:19 2014
4
5
@author: rlabbe
6
"""
7
import matplotlib.pyplot as plt
8
9
10
def show_fixed_lag_numberline():
11
fig = plt.figure()
12
ax = fig.add_subplot(111)
13
ax.set_xlim(0,10)
14
ax.set_ylim(0,10)
15
16
# draw lines
17
xmin = 1
18
xmax = 9
19
y = 5
20
height = 1
21
22
plt.hlines(y, xmin, xmax)
23
plt.vlines(xmin, y - height / 2., y + height / 2.)
24
plt.vlines(4.5, y - height / 2., y + height / 2.)
25
plt.vlines(6, y - height / 2., y + height / 2.)
26
plt.vlines(xmax, y - height / 2., y + height / 2.)
27
plt.vlines(xmax-1, y - height / 2., y + height / 2.)
28
29
# add numbers
30
plt.text(xmin, y-1.1, '$x_0$', fontsize=20, horizontalalignment='center')
31
plt.text(xmax, y-1.1, '$x_k$', fontsize=20, horizontalalignment='center')
32
plt.text(xmax-1, y-1.1, '$x_{k-1}$', fontsize=20, horizontalalignment='center')
33
plt.text(4.5, y-1.1, '$x_{k-N+1}$', fontsize=20, horizontalalignment='center')
34
plt.text(6, y-1.1, '$x_{k-N+2}$', fontsize=20, horizontalalignment='center')
35
plt.text(2.7, y-1.1, '.....', fontsize=20, horizontalalignment='center')
36
plt.text(7.2, y-1.1, '.....', fontsize=20, horizontalalignment='center')
37
38
plt.axis('off')
39
plt.show()
40
41
if __name__ == '__main__':
42
43
#show_2d_transform()
44
#show_sigma_selections()
45
46
show_sigma_transform(True)
47
#show_four_gps()
48
#show_sigma_transform()
49
#show_sigma_selections()
50
51
52