I currently have two large data sets, and I want to compare them. I have them separately, one in red and one in blue, however I would like to show the red and blue side by side. How might I go about this?
My current code is:
column_labels = list(heatmap_ylabels)
row_labels = list(heatmap_xlabels)
fig, ax = plt.subplots()
heatmap = ax.pcolor(data, cmap=plt.cm.Reds)
ax.set_xticks(np.arange(9+0.5))
ax.set_yticks(np.arange(140+0.5))
ax.invert_yaxis()
ax.xaxis.tick_top()
ax.set_xticklabels(row_labels, minor=False)
ax.set_yticklabels(column_labels, minor=False)
#plt.show()
plt.savefig('n1_heatmap')
plt.clf()
column_labels = list(heatmap_ylabels)
row_labels = list(heatmap_xlabels)
fig, ax = plt.subplots()
heatmap = ax.pcolor(data1, cmap=plt.cm.Blues)
ax.set_xticks(np.arange(9+0.5))
ax.set_yticks(np.arange(140+0.5))
ax.invert_yaxis()
ax.xaxis.tick_top()
ax.set_xticklabels(row_labels, minor=False)
ax.set_yticklabels(column_labels, minor=False)
plt.savefig('n2_heatmap')
plt.clf()
Both data
and data1
are formed of 140 different lists with information extracted from 280 different files, is there a way I can still use these two lists in order to create a heatmap which will show these data in the same figure?
So for example my heatmap will be /red/blue/red/blue etc
Here is an example of my heatmap:
EDIT:
While not showing exactly what I want, I have made a heatmap of the difference in values between the two previous heatmaps.
eg: y2 = np.subtract(y, y1)
data2.append(y2)
column_labels = list(heatmap_ylabels)
row_labels = list(heatmap_xlabels)
fig, ax = plt.subplots()
heatmap = ax.pcolor(data2, cmap=plt.cm.bwr)
ax.set_xticks(np.arange(9+0.5))
ax.set_yticks(np.arange(140+0.5))
ax.invert_yaxis()
ax.xaxis.tick_top()
ax.set_xticklabels(row_labels, minor=False)
ax.set_yticklabels(column_labels, minor=False)
plt.savefig('diff_heatmap')
plt.clf()