top | item 39214690

(no title)

greendayle | 2 years ago

import pylab as pb

x = np.arange(0, 10, 0.01)

pb.plot(x, np.sin(x)

pb.show()

what do you mean hard?

discuss

order

analog31|2 years ago

This is a minor source of confusion. Pylab and Pyplot are packages within Matplotlib. They are what most casual users experience when they say that they're using Matplotlib. I use them, they're convenient.

A minor headache is when you have to break out of Pyplot to use some of the more detailed behaviors of Matplotlib, and now you're interacting with both Pyplot and the lower level calls. For instance, plt.title('foo') and gca().set_title('foo') do the same thing.

If you're a fluent programmer, you fly past those seeming inconsistencies with barely any notice. Explaining them to a novice programmer is harder.