In [1]:
import matplotlib.pyplot as plt
plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt
In [3]:
import matplotlib.image as mpimg
img=mpimg.imread('bad_fig.png')
imgplot = plt.imshow(img)
plt.show()
In [4]:
plt.rcdefaults()
fig, ax = plt.subplots()
# Example data
all_skills= np.array(['Java', 'C#', 'C++', 'Python', 'PHP', 'JS', 'android', 'ios', '.net', 'rails'])
all_search = np.array([22.26, 10.74, 4.96, 8.30, 11.53, 9.23, 9.94, 7.53, 7.22, 8.29])
all_colors = np.array(['grey', 'grey', 'grey', 'grey', 'grey', 'grey', 'blue', 'blue', 'gold', 'gold'])
rank_search= all_search[np.argsort(all_search)]
rank_skills = all_skills[np.argsort(all_search)]
rank_colors = all_colors[np.argsort(all_search)]
y_pos = np.arange(len(rank_skills))
ax.barh(y_pos, rank_search, align='center',
color=rank_colors)
ax.set_yticks(y_pos)
ax.set_yticklabels(rank_skills)
ax.invert_yaxis() # labels read top-to-bottom
ax.set_xlabel('Percent of Stackoverflow Searches for Developer Skills')
ax.set_title('Top 10 Most in Demand Developer Skills in 2013')
ax.text(15, 2, 'Programming Language', color='black')
ax.text(15, 1.5, 'Operating System', color='blue')
ax.text(15, 1., 'Software Platform', color='gold')
plt.show()
In [ ]: