File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
galleries/examples/specialty_plots Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 13
13
import matplotlib .cbook as cbook
14
14
import matplotlib .cm as cm
15
15
from matplotlib .collections import LineCollection
16
- from matplotlib .ticker import MultipleLocator
17
16
18
17
fig = plt .figure ("MRI_with_EEG" )
19
18
28
27
29
28
# Plot the histogram of MRI intensity
30
29
ax1 = fig .add_subplot (2 , 2 , 2 )
31
- im = np .ravel (im )
32
- im = im [np .nonzero (im )] # Ignore the background
33
- im = im / (2 ** 16 - 1 ) # Normalize
34
- ax1 .hist (im , bins = 100 )
35
- ax1 .xaxis .set_major_locator (MultipleLocator (0.4 ))
30
+ im = im [im .nonzero ()] # Ignore the background
31
+ ax1 .hist (im , bins = np .arange (0 , 2 ** 16 + 1 , 512 ))
32
+ ax1 .set (xlabel = 'Intensity (a.u.)' , ylabel = 'MRI density' , yticks = [])
36
33
ax1 .minorticks_on ()
37
- ax1 .set_yticks ([])
38
- ax1 .set_xlabel ('Intensity (a.u.)' )
39
- ax1 .set_ylabel ('MRI density' )
40
34
41
35
# Load the EEG data
42
36
n_samples , n_rows = 800 , 4
72
66
73
67
ax2 .set_xlabel ('Time (s)' )
74
68
75
-
76
69
plt .tight_layout ()
77
70
plt .show ()
You can’t perform that action at this time.
0 commit comments