The data represents a time-averaged connectivity pattern between EEG electrodes. The midline represents the value 0 because the connection to its own is marked as 0.
# plot the time-averaged connectivity plt.imshow(time_average,cmap ='jet') plt.colorbar() plt.xlabel('channel') plt.ylabel('channel')
original time-averaged connectivity graph
I am trying to extract the data represented only in the top triangle of the graph using for-loop.
time_average_data_red = [[0]*105 for i in range(105)] for i in range (105): for ii in range(i): time_average_data_red[ii][i] = time_average[ii][i]
reduced time-average-data graph
Instead of making the repeating data value as 0 and plotting as above, is there a way to simply make the same graph without the lower bottom triangle of zero values?
Thank you.
What about upper triangular matrix
import numpy as np plt.imshow(np.triu(time_average, 1),cmap ='jet') ... ...
1.4m articles
1.4m replys
5 comments
57.0k users