{"id":965143,"date":"2024-12-27T04:35:08","date_gmt":"2024-12-26T20:35:08","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/965143.html"},"modified":"2024-12-27T04:35:10","modified_gmt":"2024-12-26T20:35:10","slug":"python%e4%bd%a0%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85pylab","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/965143.html","title":{"rendered":"python\u4f60\u5982\u4f55\u5b89\u88c5pylab"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24181550\/91698666-d27e-4cbb-865d-56bfb58b2796.webp\" alt=\"python\u4f60\u5982\u4f55\u5b89\u88c5pylab\" \/><\/p>\n<p><p> <strong>\u8981\u5728Python\u4e2d\u5b89\u88c5Pylab\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u3001\u786e\u4fddPython\u73af\u5883\u6b63\u786e\u914d\u7f6e\u3001\u4f7f\u7528\u5408\u9002\u7684IDE\u6765\u7ba1\u7406\u9879\u76ee\u3001\u521b\u5efa\u865a\u62df\u73af\u5883\u6765\u9694\u79bb\u4f9d\u8d56\u9879<\/strong>\u3002\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u7684Python\u548cpip\u662f\u6700\u65b0\u7248\u672c\uff0c\u4ee5\u907f\u514d\u517c\u5bb9\u6027\u95ee\u9898\u3002\u5176\u6b21\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Pylab\uff1a<code>pip install matplotlib<\/code>\u3002Matplotlib\u5e93\u5305\u542bPylab\u6a21\u5757\u3002\u63a5\u4e0b\u6765\uff0c\u5efa\u8bae\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5982PyCharm\u6216Jupyter Notebook\u6765\u7ba1\u7406\u60a8\u7684\u9879\u76ee\u548c\u4f9d\u8d56\u9879\uff0c\u56e0\u4e3a\u5b83\u4eec\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u4ee3\u7801\u7ec4\u7ec7\u548c\u8c03\u8bd5\u529f\u80fd\u3002\u6700\u540e\uff0c\u8003\u8651\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u73af\u5883\u4ee5\u786e\u4fdd\u60a8\u7684\u9879\u76ee\u4f9d\u8d56\u9879\u4e0d\u4f1a\u4e0e\u7cfb\u7edf\u7684\u5176\u4ed6Python\u9879\u76ee\u53d1\u751f\u51b2\u7a81\u3002\u8fd9\u4e9b\u6b65\u9aa4\u5c06\u5e2e\u52a9\u60a8\u987a\u5229\u5b89\u88c5\u548c\u4f7f\u7528Pylab\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5PYLAB\u7684\u57fa\u7840\u6b65\u9aa4<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5Pylab\u4e4b\u524d\uff0c\u9996\u5148\u8981\u786e\u4fdd\u60a8\u7684Python\u548cpip\u662f\u6700\u65b0\u7248\u672c\u3002Python\u662f\u4e00\u4e2a\u4e0d\u65ad\u66f4\u65b0\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u65b0\u7248\u672c\u901a\u5e38\u4f1a\u4fee\u590d\u65e7\u7248\u672c\u4e2d\u7684\u9519\u8bef\u5e76\u5f15\u5165\u65b0\u529f\u80fd\u3002\u56e0\u6b64\uff0c\u4fdd\u6301Python\u548cpip\u7684\u66f4\u65b0\u81f3\u5173\u91cd\u8981\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5\u60a8\u7684Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5bf9\u4e8epip\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u66f4\u65b0Python\u6216pip\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\uff0c\u6216\u8005\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0pip\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m pip install --upgrade pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528PIP\u5b89\u88c5MATPLOTLIB<\/p>\n<\/p>\n<p><p>Pylab\u662fMatplotlib\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u56e0\u6b64\u5b89\u88c5Matplotlib\u5373\u53ef\u83b7\u5f97Pylab\u6a21\u5757\u3002\u4f7f\u7528pip\u5b89\u88c5Matplotlib\u662f\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u3002\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5Matplotlib\u5e93\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u9879\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pylab as pylab<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u6ca1\u6709\u51fa\u73b0\u9519\u8bef\uff0c\u5219\u8868\u660e\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528\u5408\u9002\u7684IDE<\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u597d\u5730\u7ba1\u7406Python\u9879\u76ee\u548c\u4ee3\u7801\uff0c\u4f7f\u7528\u5408\u9002\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u662f\u5f88\u91cd\u8981\u7684\u3002PyCharm\u548cJupyter Notebook\u662f\u4e24\u79cd\u6d41\u884c\u7684\u9009\u62e9\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>PyCharm<\/strong>\uff1a\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684IDE\uff0c\u63d0\u4f9b\u4e86\u4ee3\u7801\u8865\u5168\u3001\u8c03\u8bd5\u548c\u7248\u672c\u63a7\u5236\u7b49\u529f\u80fd\u3002\u5b83\u8fd8\u652f\u6301\u865a\u62df\u73af\u5883\u7ba1\u7406\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u7ba1\u7406\u9879\u76ee\u7684\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Jupyter Notebook<\/strong>\uff1a\u662f\u4e00\u4e2a\u57fa\u4e8eWeb\u7684\u4ea4\u4e92\u5f0f\u8ba1\u7b97\u73af\u5883\uff0c\u7279\u522b\u9002\u5408\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u3002\u5b83\u5141\u8bb8\u60a8\u5728\u540c\u4e00\u4e2a\u6587\u6863\u4e2d\u7f16\u5199\u4ee3\u7801\u3001\u8fd0\u884c\u4ee3\u7801\u5e76\u67e5\u770b\u8f93\u51fa\uff0c\u9002\u5408\u4e8e\u4f7f\u7528Pylab\u8fdb\u884c\u53ef\u89c6\u5316\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u521b\u5efa\u865a\u62df\u73af\u5883<\/p>\n<\/p>\n<p><p>\u5728Python\u9879\u76ee\u4e2d\u4f7f\u7528\u865a\u62df\u73af\u5883\u53ef\u4ee5\u5e2e\u52a9\u60a8\u9694\u79bb\u9879\u76ee\u7684\u4f9d\u8d56\u9879\uff0c\u907f\u514d\u4e0e\u5176\u4ed6\u9879\u76ee\u53d1\u751f\u51b2\u7a81\u3002\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u865a\u62df\u73af\u5883\u3002\u4ee5\u4e0b\u662f\u521b\u5efa\u865a\u62df\u73af\u5883\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u5728\u60a8\u7684\u9879\u76ee\u76ee\u5f55\u4e2d\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u91cc\u7684<code>myenv<\/code>\u662f\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u66f4\u6539\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5728Windows\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5728Unix\u6216MacOS\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u5b89\u88c5Matplotlib\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5b8c\u6210\u9879\u76ee\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u9000\u51fa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">deactivate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u89e3\u51b3\u5b89\u88c5\u4e2d\u7684\u5e38\u89c1\u95ee\u9898<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5Pylab\u6216Matplotlib\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u5931\u8d25<\/strong>\uff1a\u5982\u679c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u9519\u8bef\uff0c\u9996\u5148\u68c0\u67e5\u60a8\u7684\u7f51\u7edc\u8fde\u63a5\u548cpip\u7248\u672c\u3002\u786e\u4fdd\u60a8\u6709\u8db3\u591f\u7684\u6743\u9650\u6765\u5b89\u88c5\u8f6f\u4ef6\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u517c\u5bb9\u6027\u95ee\u9898<\/strong>\uff1a\u786e\u4fdd\u60a8\u7684Python\u7248\u672c\u4e0eMatplotlib\u517c\u5bb9\u3002\u901a\u5e38\uff0cMatplotlib\u7684\u6700\u65b0\u7248\u672c\u652f\u6301\u6700\u65b0\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f9d\u8d56\u9879\u95ee\u9898<\/strong>\uff1a\u6709\u65f6\uff0cMatplotlib\u7684\u4f9d\u8d56\u9879\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5b89\u88c5\u5931\u8d25\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u624b\u52a8\u5b89\u88c5\u4f9d\u8d56\u9879\u53ef\u80fd\u4f1a\u6709\u6240\u5e2e\u52a9\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u5c1d\u8bd5\u5b89\u88c5NumPy\uff0c\u56e0\u4e3aMatplotlib\u4f9d\u8d56\u4e8e\u5b83\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u9a8c\u8bc1\u5b89\u88c5<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u975e\u5e38\u91cd\u8981\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u6765\u5b8c\u6210\u6b64\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pylab as pylab<\/p>\n<p>pylab.plot([1, 2, 3], [4, 5, 6])<\/p>\n<p>pylab.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u6b64\u811a\u672c\uff0c\u5982\u679c\u51fa\u73b0\u4e00\u4e2a\u5305\u542b\u76f4\u7ebf\u7684\u56fe\u5f62\u7a97\u53e3\uff0c\u5219\u8868\u660ePylab\u5df2\u6b63\u786e\u5b89\u88c5\u5e76\u53ef\u4ee5\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u63a2\u7d22PYLAB\u529f\u80fd<\/p>\n<\/p>\n<p><p>Pylab\u662fMatplotlib\u7684\u4e00\u90e8\u5206\uff0c\u63d0\u4f9b\u4e86\u591a\u79cd\u529f\u80fd\u6765\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u3002\u4ee5\u4e0b\u662fPylab\u7684\u4e00\u4e9b\u5e38\u7528\u529f\u80fd\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7ed8\u5236\u57fa\u672c\u56fe\u5f62<\/strong>\uff1aPylab\u53ef\u4ee5\u7ed8\u5236\u7ebf\u56fe\u3001\u6563\u70b9\u56fe\u3001\u67f1\u72b6\u56fe\u7b49\u57fa\u672c\u56fe\u5f62\u3002\u8fd9\u4e9b\u56fe\u5f62\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5feb\u901f\u4e86\u89e3\u6570\u636e\u7684\u57fa\u672c\u7279\u5f81\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u56fe\u5f62\u5b9a\u5236<\/strong>\uff1a\u60a8\u53ef\u4ee5\u901a\u8fc7Pylab\u5bf9\u56fe\u5f62\u8fdb\u884c\u9ad8\u5ea6\u5b9a\u5236\uff0c\u5305\u62ec\u8bbe\u7f6e\u56fe\u4f8b\u3001\u6807\u9898\u3001\u8f74\u6807\u7b7e\u7b49\u3002\u8fd9\u4f7f\u5f97\u60a8\u53ef\u4ee5\u521b\u5efa\u7b26\u5408\u81ea\u5df1\u9700\u6c42\u7684\u56fe\u5f62\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6570\u636e\u5206\u6790<\/strong>\uff1a\u7ed3\u5408NumPy\u7b49\u79d1\u5b66\u8ba1\u7b97\u5e93\uff0cPylab\u53ef\u4ee5\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u5904\u7406\u3002\u60a8\u53ef\u4ee5\u8f7b\u677e\u8fdb\u884c\u6570\u636e\u7684\u8bfb\u53d6\u3001\u5904\u7406\u548c\u53ef\u89c6\u5316\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ea4\u4e92\u5f0f\u7ed8\u56fe<\/strong>\uff1aPylab\u652f\u6301\u4ea4\u4e92\u5f0f\u7ed8\u56fe\uff0c\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u52a8\u6001\u5730\u6539\u53d8\u56fe\u5f62\u7684\u67d0\u4e9b\u53c2\u6570\uff0c\u5e76\u7acb\u5373\u770b\u5230\u6548\u679c\u3002\u8fd9\u5bf9\u4e8e\u6570\u636e\u63a2\u7d22\u548c\u8c03\u8bd5\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516b\u3001\u4f7f\u7528PYLAB\u7684\u6700\u4f73\u5b9e\u8df5<\/p>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Pylab\u65f6\uff0c\u9075\u5faa\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u6709\u6548\u5730\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u548c\u5206\u6790\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u9762\u5411\u5bf9\u8c61\u7684\u63a5\u53e3<\/strong>\uff1a\u867d\u7136Pylab\u63d0\u4f9b\u4e86\u7c7b\u4f3cMATLAB\u7684\u547d\u4ee4\u5f0f\u63a5\u53e3\uff0c\u4f46\u63a8\u8350\u4f7f\u7528Matplotlib\u7684\u9762\u5411\u5bf9\u8c61\u63a5\u53e3\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u7075\u6d3b\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fdd\u6301\u4ee3\u7801\u7b80\u6d01<\/strong>\uff1a\u5728\u521b\u5efa\u590d\u6742\u56fe\u5f62\u65f6\uff0c\u4fdd\u6301\u4ee3\u7801\u7b80\u6d01\u6709\u52a9\u4e8e\u540e\u7eed\u7684\u8c03\u8bd5\u548c\u7ef4\u62a4\u3002\u4f7f\u7528\u51fd\u6570\u6765\u5c01\u88c5\u91cd\u590d\u7684\u4ee3\u7801\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u5b9e\u8df5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6ce8\u91ca\u4ee3\u7801<\/strong>\uff1a\u5bf9\u4e8e\u590d\u6742\u7684\u56fe\u5f62\uff0c\u6dfb\u52a0\u6ce8\u91ca\u53ef\u4ee5\u5e2e\u52a9\u60a8\u548c\u4ed6\u4eba\u7406\u89e3\u4ee3\u7801\u7684\u610f\u56fe\u548c\u903b\u8f91\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9\u5408\u9002\u7684\u56fe\u5f62\u7c7b\u578b<\/strong>\uff1a\u6839\u636e\u6570\u636e\u7684\u7279\u6027\u9009\u62e9\u5408\u9002\u7684\u56fe\u5f62\u7c7b\u578b\u662f\u5173\u952e\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e\u65f6\u95f4\u5e8f\u5217\u6570\u636e\uff0c\u7ebf\u56fe\u53ef\u80fd\u662f\u4e00\u4e2a\u66f4\u597d\u7684\u9009\u62e9\uff0c\u800c\u5bf9\u4e8e\u5206\u7c7b\u6570\u636e\uff0c\u67f1\u72b6\u56fe\u6216\u997c\u56fe\u53ef\u80fd\u66f4\u5408\u9002\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e5d\u3001\u7ed3\u5408\u5176\u4ed6\u5e93\u4f7f\u7528PYLAB<\/p>\n<\/p>\n<p><p>Pylab\u672c\u8eab\u529f\u80fd\u5f3a\u5927\uff0c\u4f46\u7ed3\u5408\u5176\u4ed6\u5e93\u53ef\u4ee5\u8fdb\u4e00\u6b65\u589e\u5f3a\u5176\u529f\u80fd\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>NumPy<\/strong>\uff1aPylab\u4e0eNumPy\u65e0\u7f1d\u96c6\u6210\uff0c\u53ef\u4ee5\u8f7b\u677e\u5904\u7406\u5927\u578b\u6570\u636e\u96c6\u3002NumPy\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u6570\u7ec4\u64cd\u4f5c\u529f\u80fd\uff0c\u9002\u5408\u4e8e\u5927\u89c4\u6a21\u6570\u636e\u5904\u7406\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Pandas<\/strong>\uff1aPandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5206\u6790\u5e93\uff0c\u9002\u5408\u4e8e\u5904\u7406\u8868\u683c\u6570\u636e\u3002\u7ed3\u5408Pandas\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u8bfb\u53d6CSV\u6587\u4ef6\u3001\u5904\u7406\u6570\u636e\u5e76\u8fdb\u884c\u53ef\u89c6\u5316\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>SciPy<\/strong>\uff1aSciPy\u662f\u4e00\u4e2a\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u7684\u5e93\uff0c\u63d0\u4f9b\u4e86\u4f18\u5316\u3001\u79ef\u5206\u3001\u63d2\u503c\u7b49\u529f\u80fd\u3002\u7ed3\u5408SciPy\uff0c\u60a8\u53ef\u4ee5\u8fdb\u884c\u66f4\u590d\u6742\u7684\u79d1\u5b66\u8ba1\u7b97\u548c\u5efa\u6a21\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u5341\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u548c\u4f7f\u7528Pylab\u5e76\u4e0d\u590d\u6742\uff0c\u53ea\u9700\u6309\u7167\u4ee5\u4e0a\u6b65\u9aa4\u64cd\u4f5c\uff0c\u60a8\u5c31\u80fd\u987a\u5229\u5f00\u59cb\u4f7f\u7528Pylab\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u3002\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u6ce8\u610f\u4fdd\u6301\u73af\u5883\u7684\u72ec\u7acb\u6027\u548c\u4ee3\u7801\u7684\u53ef\u7ef4\u62a4\u6027\u3002\u7ed3\u5408\u5176\u4ed6\u79d1\u5b66\u8ba1\u7b97\u5e93\uff0cPylab\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u6df1\u5165\u5730\u5206\u6790\u548c\u7406\u89e3\u6570\u636e\u3002\u901a\u8fc7\u4e0d\u65ad\u5b9e\u8df5\u548c\u63a2\u7d22\uff0c\u60a8\u5c06\u80fd\u591f\u5145\u5206\u53d1\u6325Pylab\u5728\u6570\u636e\u53ef\u89c6\u5316\u4e2d\u7684\u6f5c\u529b\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528pip\u5b89\u88c5pylab\uff1f<\/strong><br \/>\u8981\u4f7f\u7528pip\u5b89\u88c5pylab\uff0c\u60a8\u53ef\u4ee5\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a  <\/p>\n<pre><code>pip install matplotlib\n<\/code><\/pre>\n<p>pylab\u662fmatplotlib\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u6240\u4ee5\u5b89\u88c5matplotlib\u540e\uff0c\u60a8\u5c31\u53ef\u4ee5\u4f7f\u7528pylab\u3002\u786e\u4fdd\u60a8\u7684Python\u73af\u5883\u5df2\u7ecf\u8bbe\u7f6e\u597d\uff0c\u5e76\u4e14pip\u5df2\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<p><strong>pylab\u4e0ematplotlib\u7684\u533a\u522b\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>pylab\u662fmatplotlib\u5e93\u7684\u4e00\u4e2a\u6a21\u5757\uff0c\u63d0\u4f9b\u4e86\u4e00\u79cd\u7c7b\u4f3c\u4e8eMATLAB\u7684\u73af\u5883\u6765\u521b\u5efa\u56fe\u5f62\u3002pylab\u7ed3\u5408\u4e86NumPy\u548cmatplotlib\u7684\u529f\u80fd\uff0c\u9002\u5408\u9700\u8981\u5feb\u901f\u53ef\u89c6\u5316\u6570\u636e\u7684\u7528\u6237\u3002\u76f8\u6bd4\u4e4b\u4e0b\uff0cmatplotlib\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7075\u6d3b\u548c\u5168\u9762\u7684\u7ed8\u56fe\u529f\u80fd\uff0c\u9002\u5408\u8fdb\u884c\u590d\u6742\u7684\u56fe\u5f62\u7ed8\u5236\u3002<\/p>\n<p><strong>\u5728Jupyter Notebook\u4e2d\u5982\u4f55\u4f7f\u7528pylab\uff1f<\/strong><br \/>\u5728Jupyter Notebook\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5bfc\u5165pylab\u5e76\u5f00\u59cb\u4f7f\u7528\uff1a  <\/p>\n<pre><code class=\"language-python\">import pylab as plt\n%matplotlib inline\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u4f7f\u60a8\u80fd\u591f\u5728Notebook\u4e2d\u76f4\u63a5\u663e\u793a\u56fe\u5f62\u3002\u4f7f\u7528pylab\u7684\u529f\u80fd\u6765\u7ed8\u5236\u56fe\u5f62\u975e\u5e38\u7b80\u5355\uff0c\u60a8\u53ea\u9700\u8981\u8c03\u7528\u76f8\u5173\u7684\u7ed8\u56fe\u51fd\u6570\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u5b89\u88c5Pylab\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u3001\u786e\u4fddPython\u73af\u5883\u6b63\u786e\u914d\u7f6e\u3001\u4f7f\u7528\u5408\u9002\u7684IDE\u6765\u7ba1\u7406\u9879 [&hellip;]","protected":false},"author":3,"featured_media":965147,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/965143"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=965143"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/965143\/revisions"}],"predecessor-version":[{"id":965151,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/965143\/revisions\/965151"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/965147"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=965143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=965143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=965143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}