Matplotlib is the whole package; pylabisamoduleinmatplotlibthatgetsinstalledalongsidematplotlib; andmatplotlib.pyplotisamoduleinmatplotlib。
pyplotprovidesthestate-machineinterfacetotheunderlyingplottinglibraryinmatplotlib.thismeansthatfiguresandaxesareimplicitly esiredplot.forexample,callingplotfrompyplotwillautomaticallycreatethenecessaryfigureandaxestoachievethedesiredplot.setiredplot
pylabcombinesthepyplotfunctionality (for plotting ) withthenumpyfunctionality (formathematicsandforworkingwitharrays )。 in a single namespace,makingthatnamespace (or environment ) even more MATLAB-like. For example,onecallthesinandcosfunctionctionatione
thepyplotinterfaceisgenerallypreferredfornon -交互打印(I.e .scripting ).thepylabinterfaceisconvenientforient asitminimizestyping.notethatthisiswhatyougetifyousetheipythonshellwiththe-pylaboption,whimportseverythingfrompylabantion