I am reading a book and I came across this code:
import matplotlib.pyplot as plt
plt.scatter(x,y)
plt.title(\"Web traffic over the last month\")
plt.xlabel(\"Tim
In order to understand range, open python and write in sequence the following commands:
range(7)
range(4,8)
range(3,11,2)
For the list comprehensions within the plt.xticks, they are basically a compact way of writing loops. They are very common, useful and neat. In order to understand them:
[w*2 for w in range(10)]
[w*2 for w in range(10) if w < 4]
Finally, for the command plt.xticks itself you can check http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.xticks for a very brief explanation with simple examples.