From: Michael K. <mi...@kl...> - 2011-08-03 14:43:39
|
Hello, I really like Python and Matplotlib, and recommend it to all my colleagues. I have found this plot: http://en.wikipedia.org/wiki/File:Operating_system_usage_share.svg I think it looks good, it is made in R. The code looks clean, not many settings etc. I wanted to see if I could make a similar plot in Matplotlib. So far, this is what I got: from pylab import * data = [37.92, 29.72, 13.09, 7.40, 2.80, 2.07] x = arange(len(data)) ax = subplot(111) bar(x, data) xticks( x + 0.5, ("Windows\nXP", "Windows\n7", "Windows\nVista", "MacOS X", "iOS", "Linux") ) title("Usage share of web client operating systems: May 2011") ylabel("Percent Usage") savefig('barplot.png',format='png') I have stolen most of the code from an example: http://matplotlib.sourceforge.net/examples/pylab_examples/custom_ticker1.html I havent figured out how to color the bars differently, does anybody know how to do this? Sincerely Michael |