-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_plot.py
More file actions
55 lines (26 loc) · 757 Bytes
/
data_plot.py
File metadata and controls
55 lines (26 loc) · 757 Bytes
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
51
52
53
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.widgets import Slider
#x = np.linspace(0, 3, 20)
#y = np.linspace(0, 9, 20)
#plt.plot(x,y)
#plt.plot(x,y,'o')
#plt.show()
min0 = 0
max0 = 25
fig = plt.figure(figsize=[10,10])
images=max0*np.random.rand(20,20)
x=plt.imshow(images)
axcolor = 'lightgoldenrodyellow'
axmin = fig.add_axes([0.25, 0.1, 0.65, 0.03], facecolor=axcolor)
axmax = fig.add_axes([0.25, 0.15, 0.65, 0.03], facecolor=axcolor)
smin = Slider(axmin, 'Min', 10, 30, valinit=min0)
smax = Slider(axmax, 'Max', 10, 30, valinit=max0)
plt.colormaps()
plt.colorbar(x)
def update(val):
x.set_clim([smin.val,smax.val])
fig.canvas.draw()
smin.on_changed(update)
smax.on_changed(update)
plt.show()