File tree Expand file tree Collapse file tree
galleries/examples/specialty_plots Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import matplotlib .cbook as cbook
1414import matplotlib .cm as cm
1515from matplotlib .collections import LineCollection
16- from matplotlib .ticker import MultipleLocator
1716
1817fig = plt .figure ("MRI_with_EEG" )
1918
2827
2928# Plot the histogram of MRI intensity
3029ax1 = 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 = [])
3633ax1 .minorticks_on ()
37- ax1 .set_yticks ([])
38- ax1 .set_xlabel ('Intensity (a.u.)' )
39- ax1 .set_ylabel ('MRI density' )
4034
4135# Load the EEG data
4236n_samples , n_rows = 800 , 4
7266
7367ax2 .set_xlabel ('Time (s)' )
7468
75-
7669plt .tight_layout ()
7770plt .show ()
You can’t perform that action at this time.
0 commit comments