Issue
I can plot in Python using either:
import matplotlib
matplotlib.pyplot.plot(...)
Or:
import pylab
pylab.plot(...)
Both of these use matplotlib
.
Which is recommend as the correct method to plot? Why?
Solution
From the official documentation, as shown below, the recommendation is to use matplotlib.pyplot
. This is not an opinion.
The documentation at Matplotlib, pyplot and pylab: how are they related?, which also describes the difference between pyplot and pylab, states: "Although many examples use pylab, it is no longer recommended.".
2021-05-06 Edit:
Since heavily importing into the global namespace may result in unexpected behavior, the use of pylab is strongly discouraged. Use matplotlib.pyplot instead.
Answered By - Apostolos
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.