-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplot.py
More file actions
51 lines (41 loc) · 1.41 KB
/
plot.py
File metadata and controls
51 lines (41 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def plotImageWithColorBar(I,cmap=plt.cm.Greys_r,title=''):
"""this function displays an image and a color bar"""
fig = plt.figure(figsize=(8,7))
ax=plt.subplot(1,1,1)
plt.subplots_adjust(left=0.01, right=0.99, top=0.9, bottom=0)
implot=plt.imshow(I,cmap)
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
plt.colorbar(implot, use_gridspec=True)
plt.title(title)
def plot3D(X, Y, Z, title=''):
print X
print Y
print Z
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_wireframe(X, Y, Z)
plt.title(title)
def plotColorImage(I,title=''):
"""this function displays an image and a color bar"""
fig = plt.figure(figsize=(8,7))
ax=plt.subplot(1,1,1)
plt.subplots_adjust(left=0.01, right=0.99, top=0.9, bottom=0)
implot=plt.imshow(I)
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
plt.colorbar(implot, use_gridspec=True)
plt.title(title)
def plotHistoCurve(I, title=''):
"""this function displays an image and a color bar"""
fig = plt.figure(figsize=(8,7))
ax=plt.subplot(1,1,1)
# plt.subplots_adjust(left=0.01, right=0.99, top=0.9, bottom=0)
plt.plot(I)
plt.title(title)
def pause():
"""this function allows to refresh a figure and do a pause"""
plt.draw()
plt.show(block=True)