In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
cmap = sns.diverging_palette(220, 20, n=10, as_cmap=True)
arr = np.zeros((50,50))
arr[:, :30][:26, :12] = 65
arr[:, :30][:26, 12:] = 85
arr[:, :30][26:, :] = 100
arr[:, 30:][:20, :] = 40
arr[:, 30:][20:, :] = 55
fig = plt.figure()
ax = fig.add_axes([0.1, 0.1, 0.9, 0.9])
plt.ylim(0,50)
plt.xlim(0,50)
ax.set_yticks([])
ax.set_xticks([])
plt.imshow(arr, cmap=cmap, interpolation='none')
plt.colorbar()
plt.savefig('chart1.svg', cmap=cmap, interpolation='none')
In [21]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
cmap = sns.diverging_palette(220, 20, n=10, as_cmap=True)
arr = np.zeros((50,50))
arr[:, :10][:20, :] = 40
arr[:, :10][20:37, :] = 55
arr[:, :10][37:, :] = 40
arr[:, 10:35][:15, :6] = 85
arr[:, 10:35][:15, 6:14] = 65
arr[:, 10:35][:15, 14:] = 85
arr[:, 10:35][15:35, :] = 100
arr[:, 10:35][35:, :6] = 85
arr[:, 10:35][35:, 6:14] = 65
arr[:, 10:35][35:, 14:] = 85
arr[:, 35:][:20, :] = 40
arr[:, 35:][20:37, :] = 55
arr[:, 35:][37:, :] = 40
fig = plt.figure()
ax = fig.add_axes([0.1, 0.1, 0.9, 0.9])
plt.ylim(0,50)
plt.xlim(0,50)
ax.set_yticks([])
ax.set_xticks([])
plt.imshow(arr, cmap=cmap, interpolation='none')
plt.colorbar()
plt.savefig('chart2.svg')
In [24]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from random import choice
import seaborn as sns
sns.set(color_codes=True)
cmap = sns.diverging_palette(220, 20, n=10, as_cmap=True)
color_100 = cmap(.999) #t6
color_85 = cmap(float(85-40)/float(100-40)) #t8
color_65 = cmap(float(65-40)/float(100-40)) #t9
color_55 = cmap(float(55-40)/float(100-40)) #t4
color_40 = cmap(.0) #t5
fig = plt.figure()
ax = fig.add_axes([0.1, 0.1, 0.9, 0.9], polar=True)
for i in xrange(12*9):
if 4 < i % 12 < 10:
if i < 5*12:
color = color_55
else:
color = color_40
else:
if i < 6*12:
if 0 < i % 12 < 5:
color = color_65
else:
color = color_85
else:
color = color_100
ax.bar(i * 2 * np.pi / 12, 1, width=2 * np.pi / 12, bottom=i / 12,
color=color, edgecolor = color)
plt.ylim(0,9)
ax.set_yticks([])
ax.set_xticks([np.pi/2,np.pi,3*np.pi/2, 2*np.pi])
#plt.show()
plt.savefig('chart3.svg')
In [25]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from random import choice
import seaborn as sns
sns.set(color_codes=True)
cmap = sns.diverging_palette(220, 20, n=10, as_cmap=True)
fig = plt.figure()
ax = fig.add_axes([0.1, 0.1, 0.9, 0.9], polar=True)
for i in xrange(12*9):
if 4 < i % 12 < 10:
if 3*12 < i < 7*12:
color = color_55
else:
color = color_40
else:
if 5*12 <= i < 8*12:
color = color_100
else:
if 0 < i % 12 < 3:
color = color_65
else:
color = color_85
ax.bar(i * 2 * np.pi / 12, 1, width=2 * np.pi / 12, bottom=i / 12,
color=color, edgecolor = color)
plt.ylim(0,9)
ax.set_yticks([])
ax.set_xticks([np.pi/2,np.pi,3*np.pi/2, 2*np.pi])
#plt.show()
plt.savefig('chart4.svg')
In [ ]: