{"id":20741,"date":"2024-11-19T14:14:40","date_gmt":"2024-11-19T06:14:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/20741\/"},"modified":"2024-11-19T14:14:40","modified_gmt":"2024-11-19T06:14:40","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8sublime%e4%b8%ad%e8%bf%90%e8%a1%8cmatplotlib","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/20741\/","title":{"rendered":"\u5982\u4f55\u5728sublime\u4e2d\u8fd0\u884cmatplotlib"},"content":{"rendered":"<blockquote><p>\n  \u5728 sublime text \u4e2d\u8fd0\u884c matplotlib \u7684\u6b65\u9aa4\u5982\u4e0b\uff1a\u5b89\u88c5 matplotlib \u5305\u3002\u5b89\u88c5 matplotlib \u63d2\u4ef6\u3002\u521b\u5efa\u4e00\u4e2a\u6269\u5c55\u540d\u4e3a .py \u7684\u65b0\u6587\u4ef6\u3002\u5bfc\u5165 matplotlib\u3002\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62\u3002\u663e\u793a\u56fe\u5f62\u3002\u4fdd\u5b58\u5e76\u8fd0\u884c\u4ee3\u7801\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/03\/2024040317002171428.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5728sublime\u4e2d\u8fd0\u884cmatplotlib\u63d2\u56fe\" alt=\"\u5982\u4f55\u5728sublime\u4e2d\u8fd0\u884cmatplotlib\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Sublime Text \u4e2d\u8fd0\u884c Matplotlib<\/strong><\/p>\n<p>\u5728 Sublime Text \u4e2d\u8fd0\u884c Matplotlib \u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5 Matplotlib \u5305<\/strong><\/p>\n<p>\u901a\u8fc7\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u5b89\u88c5 Matplotlib\uff1a<\/p>\n<pre>pip install matplotlib<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u5728 Sublime Text \u4e2d\u5b89\u88c5 Matplotlib \u63d2\u4ef6<\/strong><\/p>\n<p>\u6253\u5f00 Package Control \u5e76\u641c\u7d22 &#8220;Matplotlib&#8221; \u63d2\u4ef6\uff0c\u7136\u540e\u5b89\u88c5\u5b83\u3002<\/p>\n<p><strong>3. \u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6<\/strong><\/p>\n<p>\u5728 Sublime Text \u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\uff0c\u6269\u5c55\u540d\u4e3a .py\u3002<\/p>\n<p><strong>4. \u5bfc\u5165 Matplotlib<\/strong><\/p>\n<p>\u5728\u6587\u4ef6\u4e2d\u5bfc\u5165 Matplotlib\uff1a<\/p>\n<pre>import matplotlib.pyplot as plt<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>5. \u521b\u5efa\u4e00\u4e2a\u56fe\u5f62<\/strong><\/p>\n<p>\u4f7f\u7528 Matplotlib \u51fd\u6570\u521b\u5efa\u56fe\u5f62\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>plt.plot([1, 2, 3, 4], [5, 6, 7, 8])<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>6. \u663e\u793a\u56fe\u5f62<\/strong><\/p>\n<p>\u8c03\u7528 plt.show() \u51fd\u6570\u663e\u793a\u56fe\u5f62\uff1a<\/p>\n<pre>plt.show()<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>7. \u5c06\u4ee3\u7801\u4fdd\u5b58\u5e76\u8fd0\u884c<\/strong><\/p>\n<p>\u4fdd\u5b58\u6587\u4ef6\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a .py \u6269\u5c55\u540d\u3002\u7136\u540e\uff0c\u6253\u5f00 Sublime Text \u7684\u8c03\u8bd5\u63a7\u5236\u53f0\uff08Ctrl + \uff09\uff0c\u8f93\u5165  file_name.py` \u5e76\u6309\u56de\u8f66\u952e\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5728\u4e2d\u8fd0\u884cmatplotlib\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 sublime text \u4e2d\u8fd0\u884c matplotlib \u7684\u6b65\u9aa4\u5982\u4e0b\uff1a\u5b89\u88c5 matplotlib \u5305\u3002\u5b89\u88c5 matplotlib \u63d2\u4ef6\u3002\u521b\u5efa\u4e00\u4e2a\u6269\u5c55\u540d\u4e3a .py \u7684\u65b0\u6587\u4ef6\u3002\u5bfc\u5165 matplotlib\u3002\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62\u3002\u663e\u793a\u56fe\u5f62\u3002\u4fdd\u5b58\u5e76\u8fd0\u884c\u4ee3\u7801\u3002 \u5982\u4f55\u5728 Sublime Text \u4e2d\u8fd0\u884c Matplotlib \u5728 Sublime Text \u4e2d\u8fd0\u884c Matplotlib \u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u5b89\u88c5 Matplotlib \u5305 \u901a\u8fc7\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u5b89\u88c5 Matplotlib\uff1a pip install matplotlib \u767b\u5f55\u540e\u590d\u5236 2. \u5728 Sublime Text \u4e2d\u5b89\u88c5 Matplotlib \u63d2\u4ef6 \u6253\u5f00 Package Control \u5e76\u641c\u7d22 &#8220;Matplotlib&#8221; \u63d2\u4ef6\uff0c\u7136\u540e\u5b89\u88c5\u5b83\u3002 3. \u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6 \u5728 Sublime Text \u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\uff0c\u6269\u5c55\u540d\u4e3a .py\u3002 4. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-20741","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=20741"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20741\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=20741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=20741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=20741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}