Sunday 8 September 2013

Matplotlib Bar Customization

Matplotlib Bar Customization

This part of my code produces the bar chart in figure (1). I wonder how to
modify it to produce the bar chart in figure (2) which is way more
readable.
axs[4].set_xticks(range(N))
axs[4].set_xticklabels(words[inds],rotation = 'vertical')
axs[4].set_xlabel('word')
axs[4].set_yscale('log')
axs[4].set_ylabel('pagerank')
axs[4].set_title('Sorted PageRank biased by total word frequencies (c =
'+str(c4)+')')
axs[4].bar(range(N),p4[inds],lw=2.5, align='center')
plt.subplots_adjust(hspace=.5)
plt.savefig('./figures/pageranks.pdf')
Figure 1
Figure 2

No comments:

Post a Comment