{"id":1146121,"date":"2025-01-08T23:14:17","date_gmt":"2025-01-08T15:14:17","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1146121.html"},"modified":"2025-01-08T23:14:19","modified_gmt":"2025-01-08T15:14:19","slug":"%e5%9c%a8python%e4%b8%ad%e5%a6%82%e4%bd%95%e5%b0%86%e4%ba%8c%e7%bb%b4%e6%95%b0%e6%8d%ae%e9%9b%86%e5%8f%af%e8%a7%86%e5%8c%96","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1146121.html","title":{"rendered":"\u5728python\u4e2d\u5982\u4f55\u5c06\u4e8c\u7ef4\u6570\u636e\u96c6\u53ef\u89c6\u5316"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24182339\/6c802e7b-e73b-480a-a2b2-25e80f20e939.webp\" alt=\"\u5728python\u4e2d\u5982\u4f55\u5c06\u4e8c\u7ef4\u6570\u636e\u96c6\u53ef\u89c6\u5316\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u5c06\u4e8c\u7ef4\u6570\u636e\u96c6\u53ef\u89c6\u5316\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u6709\uff1aMatplotlib\u3001Seaborn\u3001Pandas\u4e2d\u7684plot\u529f\u80fd\u3002<\/strong>\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u5de5\u5177\uff0c\u5e76\u63d0\u4f9b\u4ee3\u7801\u793a\u4f8b\u548c\u5177\u4f53\u7684\u4f7f\u7528\u573a\u666f\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528Matplotlib\u8fdb\u884c\u4e8c\u7ef4\u6570\u636e\u96c6\u7684\u53ef\u89c6\u5316\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001MATPLOTLIB<\/h3>\n<\/p>\n<p><p><strong>Matplotlib<\/strong>\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u7ed8\u56fe\u5e93\uff0c\u53ef\u4ee5\u751f\u6210\u5404\u79cd\u56fe\u8868\uff0c\u5305\u62ec\u6298\u7ebf\u56fe\u3001\u67f1\u72b6\u56fe\u3001\u6563\u70b9\u56fe\u7b49\u3002\u5b83\u7684\u7075\u6d3b\u6027\u548c\u5f3a\u5927\u7684\u81ea\u5b9a\u4e49\u529f\u80fd\u4f7f\u5176\u6210\u4e3a\u6570\u636e\u53ef\u89c6\u5316\u7684\u9996\u9009\u5de5\u5177\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5\u548c\u57fa\u672c\u4f7f\u7528<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86Matplotlib\u5e93\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5f00\u59cb\u7ed8\u5236\u56fe\u8868\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u7528Matplotlib\u7ed8\u5236\u4e00\u4e2a\u57fa\u672c\u7684\u6563\u70b9\u56fe\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u521b\u5efa\u6570\u636e\u96c6<\/strong><\/h2>\n<p>x = [1, 2, 3, 4, 5]<\/p>\n<p>y = [2, 3, 5, 7, 11]<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe<\/strong><\/h2>\n<p>plt.scatter(x, y)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Simple Scatter Plot&#39;)<\/p>\n<p>plt.xlabel(&#39;X-axis&#39;)<\/p>\n<p>plt.ylabel(&#39;Y-axis&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6563\u70b9\u56fe<\/h4>\n<\/p>\n<p><p>\u6563\u70b9\u56fe\u662f\u7528\u4e8e\u663e\u793a\u4e24\u4e2a\u53d8\u91cf\u4e4b\u95f4\u5173\u7cfb\u7684\u56fe\u8868\u3002\u5728\u6570\u636e\u79d1\u5b66\u4e2d\uff0c\u6563\u70b9\u56fe\u5e38\u7528\u4e8e\u63a2\u7d22\u6027\u6570\u636e\u5206\u6790\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u751f\u6210\u968f\u673a\u6570\u636e<\/strong><\/h2>\n<p>np.random.seed(0)<\/p>\n<p>x = np.random.rand(50)<\/p>\n<p>y = np.random.rand(50)<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe<\/strong><\/h2>\n<p>plt.scatter(x, y, c=&#39;blue&#39;, alpha=0.5, label=&#39;Data points&#39;)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Scatter Plot Example&#39;)<\/p>\n<p>plt.xlabel(&#39;X-axis&#39;)<\/p>\n<p>plt.ylabel(&#39;Y-axis&#39;)<\/p>\n<p>plt.legend()<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u6298\u7ebf\u56fe<\/h4>\n<\/p>\n<p><p>\u6298\u7ebf\u56fe\u662f\u53e6\u4e00\u79cd\u5e38\u7528\u7684\u4e8c\u7ef4\u56fe\u8868\uff0c\u7528\u4e8e\u663e\u793a\u6570\u636e\u70b9\u968f\u65f6\u95f4\u7684\u53d8\u5316\u8d8b\u52bf\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u6570\u636e\u96c6<\/p>\n<p>x = [1, 2, 3, 4, 5]<\/p>\n<p>y = [2, 3, 5, 7, 11]<\/p>\n<h2><strong>\u7ed8\u5236\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(x, y, marker=&#39;o&#39;)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Simple Line Plot&#39;)<\/p>\n<p>plt.xlabel(&#39;X-axis&#39;)<\/p>\n<p>plt.ylabel(&#39;Y-axis&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4\u3001\u67f1\u72b6\u56fe<\/h4>\n<\/p>\n<p><p>\u67f1\u72b6\u56fe\u7528\u4e8e\u6bd4\u8f83\u4e0d\u540c\u7c7b\u522b\u7684\u6570\u636e\u70b9\u7684\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u6570\u636e\u96c6<\/p>\n<p>categories = [&#39;A&#39;, &#39;B&#39;, &#39;C&#39;, &#39;D&#39;, &#39;E&#39;]<\/p>\n<p>values = [5, 7, 3, 8, 4]<\/p>\n<h2><strong>\u7ed8\u5236\u67f1\u72b6\u56fe<\/strong><\/h2>\n<p>plt.bar(categories, values, color=&#39;green&#39;)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Bar Chart Example&#39;)<\/p>\n<p>plt.xlabel(&#39;Categories&#39;)<\/p>\n<p>plt.ylabel(&#39;Values&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001SEABORN<\/h3>\n<\/p>\n<p><p><strong>Seaborn<\/strong>\u662f\u57fa\u4e8eMatplotlib\u7684\u9ad8\u7ea7\u6570\u636e\u53ef\u89c6\u5316\u5e93\uff0c\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7f8e\u89c2\u548c\u590d\u6742\u7684\u56fe\u8868\u3002\u5b83\u7b80\u5316\u4e86\u8bb8\u591aMatplotlib\u7684\u8bbe\u7f6e\uff0c\u5e76\u6dfb\u52a0\u4e86\u8bb8\u591a\u65b0\u7684\u56fe\u8868\u7c7b\u578b\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5\u548c\u57fa\u672c\u4f7f\u7528<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u5b89\u88c5Seaborn\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install seaborn<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684Seaborn\u6563\u70b9\u56fe\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import seaborn as sns<\/p>\n<h2><strong>\u751f\u6210\u968f\u673a\u6570\u636e<\/strong><\/h2>\n<p>np.random.seed(0)<\/p>\n<p>x = np.random.rand(50)<\/p>\n<p>y = np.random.rand(50)<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe<\/strong><\/h2>\n<p>sns.scatterplot(x=x, y=y)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Seaborn Scatter Plot Example&#39;)<\/p>\n<p>plt.xlabel(&#39;X-axis&#39;)<\/p>\n<p>plt.ylabel(&#39;Y-axis&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6563\u70b9\u56fe<\/h4>\n<\/p>\n<p><p>Seaborn\u7684\u6563\u70b9\u56fe\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u6dfb\u52a0\u56de\u5f52\u7ebf\u548c\u4e0d\u540c\u7684\u8c03\u8272\u677f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u751f\u6210\u968f\u673a\u6570\u636e<\/p>\n<p>np.random.seed(0)<\/p>\n<p>x = np.random.rand(50)<\/p>\n<p>y = np.random.rand(50)<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe\u5e76\u6dfb\u52a0\u56de\u5f52\u7ebf<\/strong><\/h2>\n<p>sns.regplot(x=x, y=y, scatter_kws={&#39;s&#39;:50, &#39;alpha&#39;:0.5}, line_kws={&#39;color&#39;:&#39;red&#39;})<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Seaborn Scatter Plot with Regression Line&#39;)<\/p>\n<p>plt.xlabel(&#39;X-axis&#39;)<\/p>\n<p>plt.ylabel(&#39;Y-axis&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u7bb1\u7ebf\u56fe<\/h4>\n<\/p>\n<p><p>\u7bb1\u7ebf\u56fe\u7528\u4e8e\u663e\u793a\u6570\u636e\u7684\u5206\u5e03\u60c5\u51b5\uff0c\u5305\u62ec\u4e2d\u4f4d\u6570\u3001\u56db\u5206\u4f4d\u6570\u548c\u5f02\u5e38\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u6570\u636e\u96c6<\/p>\n<p>data = np.random.normal(size=(100, 4))<\/p>\n<h2><strong>\u7ed8\u5236\u7bb1\u7ebf\u56fe<\/strong><\/h2>\n<p>sns.boxplot(data=data)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Box Plot Example&#39;)<\/p>\n<p>plt.xlabel(&#39;Categories&#39;)<\/p>\n<p>plt.ylabel(&#39;Values&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4\u3001\u70ed\u56fe<\/h4>\n<\/p>\n<p><p>\u70ed\u56fe\u7528\u4e8e\u663e\u793a\u77e9\u9635\u6570\u636e\u7684\u70ed\u5ea6\u5206\u5e03\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u6570\u636e\u96c6<\/p>\n<p>data = np.random.rand(10, 12)<\/p>\n<h2><strong>\u7ed8\u5236\u70ed\u56fe<\/strong><\/h2>\n<p>sns.heatmap(data, annot=True, cmap=&#39;coolwarm&#39;)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898<\/strong><\/h2>\n<p>plt.title(&#39;Heatmap Example&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001PANDAS\u4e2d\u7684PLOT\u529f\u80fd<\/h3>\n<\/p>\n<p><p><strong>Pandas<\/strong>\u662fPython\u4e2d\u5904\u7406\u6570\u636e\u7684\u5f3a\u5927\u5de5\u5177\uff0c\u5185\u7f6e\u4e86\u7b80\u5355\u7684\u7ed8\u56fe\u529f\u80fd\uff0c\u53ef\u4ee5\u5feb\u901f\u751f\u6210\u6570\u636e\u7684\u53ef\u89c6\u5316\u56fe\u8868\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5\u548c\u57fa\u672c\u4f7f\u7528<\/h4>\n<\/p>\n<p><p>Pandas\u901a\u5e38\u4e0eMatplotlib\u4e00\u8d77\u4f7f\u7528\uff0c\u786e\u4fdd\u5df2\u5b89\u88c5\u8fd9\u4e24\u4e2a\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pandas matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662fPandas\u7684\u57fa\u672c\u7ed8\u56fe\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u521b\u5efa\u6570\u636e\u96c6<\/strong><\/h2>\n<p>data = {<\/p>\n<p>    &#39;A&#39;: [1, 2, 3, 4, 5],<\/p>\n<p>    &#39;B&#39;: [2, 3, 5, 7, 11]<\/p>\n<p>}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<h2><strong>\u7ed8\u5236\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>df.plot(x=&#39;A&#39;, y=&#39;B&#39;, kind=&#39;line&#39;, marker=&#39;o&#39;)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Pandas Line Plot Example&#39;)<\/p>\n<p>plt.xlabel(&#39;A&#39;)<\/p>\n<p>plt.ylabel(&#39;B&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6563\u70b9\u56fe<\/h4>\n<\/p>\n<p><p>Pandas\u53ef\u4ee5\u76f4\u63a5\u751f\u6210\u6563\u70b9\u56fe\uff0c\u9002\u7528\u4e8e\u5feb\u901f\u6570\u636e\u53ef\u89c6\u5316\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u6570\u636e\u96c6<\/p>\n<p>data = {<\/p>\n<p>    &#39;A&#39;: np.random.rand(50),<\/p>\n<p>    &#39;B&#39;: np.random.rand(50)<\/p>\n<p>}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe<\/strong><\/h2>\n<p>df.plot(kind=&#39;scatter&#39;, x=&#39;A&#39;, y=&#39;B&#39;, color=&#39;blue&#39;, alpha=0.5)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Pandas Scatter Plot Example&#39;)<\/p>\n<p>plt.xlabel(&#39;A&#39;)<\/p>\n<p>plt.ylabel(&#39;B&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u67f1\u72b6\u56fe<\/h4>\n<\/p>\n<p><p>Pandas\u7684\u67f1\u72b6\u56fe\u529f\u80fd\u975e\u5e38\u7b80\u4fbf\uff0c\u9002\u7528\u4e8e\u6570\u636e\u7684\u5feb\u901f\u6bd4\u8f83\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u6570\u636e\u96c6<\/p>\n<p>data = {<\/p>\n<p>    &#39;Categories&#39;: [&#39;A&#39;, &#39;B&#39;, &#39;C&#39;, &#39;D&#39;, &#39;E&#39;],<\/p>\n<p>    &#39;Values&#39;: [5, 7, 3, 8, 4]<\/p>\n<p>}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<h2><strong>\u7ed8\u5236\u67f1\u72b6\u56fe<\/strong><\/h2>\n<p>df.plot(kind=&#39;bar&#39;, x=&#39;Categories&#39;, y=&#39;Values&#39;, color=&#39;green&#39;)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Pandas Bar Chart Example&#39;)<\/p>\n<p>plt.xlabel(&#39;Categories&#39;)<\/p>\n<p>plt.ylabel(&#39;Values&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4\u3001\u76f4\u65b9\u56fe<\/h4>\n<\/p>\n<p><p>\u76f4\u65b9\u56fe\u7528\u4e8e\u663e\u793a\u6570\u636e\u7684\u9891\u7387\u5206\u5e03\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u6570\u636e\u96c6<\/p>\n<p>data = {<\/p>\n<p>    &#39;Values&#39;: np.random.randn(1000)<\/p>\n<p>}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<h2><strong>\u7ed8\u5236\u76f4\u65b9\u56fe<\/strong><\/h2>\n<p>df[&#39;Values&#39;].plot(kind=&#39;hist&#39;, bins=30, alpha=0.5)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&#39;Pandas Histogram Example&#39;)<\/p>\n<p>plt.xlabel(&#39;Values&#39;)<\/p>\n<p>plt.ylabel(&#39;Frequency&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python\u4e2d\u6709\u591a\u79cd\u5de5\u5177\u53ef\u4ee5\u7528\u4e8e\u4e8c\u7ef4\u6570\u636e\u96c6\u7684\u53ef\u89c6\u5316\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u662fMatplotlib\u3001Seaborn\u548cPandas\u3002\u8fd9\u4e9b\u5de5\u5177\u5404\u6709\u4f18\u52a3\uff0c\u9009\u62e9\u54ea\u4e00\u79cd\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u4f7f\u7528\u573a\u666f\u548c\u9700\u6c42\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>Matplotlib<\/strong>\uff1a\u63d0\u4f9b\u4e86\u6700\u4e3a\u7075\u6d3b\u548c\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u9002\u5408\u9700\u8981\u9ad8\u5ea6\u81ea\u5b9a\u4e49\u7684\u56fe\u8868\u3002<\/li>\n<li><strong>Seaborn<\/strong>\uff1a\u57fa\u4e8eMatplotlib\uff0c\u7b80\u5316\u4e86\u8bb8\u591a\u64cd\u4f5c\uff0c\u63d0\u4f9b\u4e86\u66f4\u7f8e\u89c2\u7684\u56fe\u8868\uff0c\u9002\u5408\u5feb\u901f\u751f\u6210\u590d\u6742\u56fe\u8868\u3002<\/li>\n<li><strong>Pandas<\/strong>\uff1a\u5185\u7f6e\u7684\u7ed8\u56fe\u529f\u80fd\uff0c\u9002\u5408\u5feb\u901f\u6570\u636e\u53ef\u89c6\u5316\uff0c\u7279\u522b\u662f\u4e0e\u6570\u636e\u5904\u7406\u76f8\u7ed3\u5408\u65f6\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u672c\u6587\u4e2d\u7684\u793a\u4f8b\u4ee3\u7801\u548c\u89e3\u91ca\uff0c\u5e0c\u671b\u80fd\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u8fd9\u4e9b\u5de5\u5177\u8fdb\u884c\u4e8c\u7ef4\u6570\u636e\u96c6\u7684\u53ef\u89c6\u5316\u3002\u5982\u679c\u4f60\u662f\u521d\u5b66\u8005\uff0c\u5efa\u8bae\u4ecePandas\u7684\u7ed8\u56fe\u529f\u80fd\u5165\u624b\uff0c\u518d\u9010\u6b65\u5b66\u4e60Matplotlib\u548cSeaborn\u7684\u9ad8\u7ea7\u7528\u6cd5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Python\u4e2d\u6709\u54ea\u4e9b\u5e38\u7528\u7684\u5e93\u53ef\u4ee5\u7528\u4e8e\u4e8c\u7ef4\u6570\u636e\u96c6\u7684\u53ef\u89c6\u5316\uff1f<\/strong><br \/>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u5f3a\u5927\u7684\u5e93\u6765\u8fdb\u884c\u4e8c\u7ef4\u6570\u636e\u96c6\u7684\u53ef\u89c6\u5316\u3002\u5176\u4e2d\uff0cMatplotlib\u662f\u6700\u57fa\u7840\u4e14\u5e7f\u6cdb\u4f7f\u7528\u7684\u5e93\uff0c\u5b83\u53ef\u4ee5\u521b\u5efa\u5404\u79cd\u7c7b\u578b\u7684\u56fe\u8868\uff0c\u5982\u6563\u70b9\u56fe\u3001\u6298\u7ebf\u56fe\u548c\u67f1\u72b6\u56fe\u3002Seaborn\u662f\u57fa\u4e8eMatplotlib\u7684\u9ad8\u7ea7\u63a5\u53e3\uff0c\u4e13\u6ce8\u4e8e\u7edf\u8ba1\u56fe\u8868\u7684\u7ed8\u5236\uff0c\u80fd\u591f\u8ba9\u6570\u636e\u53ef\u89c6\u5316\u66f4\u5177\u7f8e\u611f\u548c\u4fe1\u606f\u6027\u3002\u6b64\u5916\uff0cPlotly\u548cBokeh\u7b49\u5e93\u5219\u4e13\u6ce8\u4e8e\u4ea4\u4e92\u5f0f\u53ef\u89c6\u5316\uff0c\u9002\u5408\u9700\u8981\u52a8\u6001\u5c55\u793a\u6570\u636e\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n<p><strong>\u5982\u4f55\u9009\u62e9\u9002\u5408\u7684\u6570\u636e\u53ef\u89c6\u5316\u56fe\u8868\u7c7b\u578b\uff1f<\/strong><br \/>\u9009\u62e9\u5408\u9002\u7684\u56fe\u8868\u7c7b\u578b\u4e3b\u8981\u53d6\u51b3\u4e8e\u6570\u636e\u7684\u6027\u8d28\u548c\u5206\u6790\u7684\u76ee\u7684\u3002\u6563\u70b9\u56fe\u9002\u5408\u5c55\u793a\u4e24\u4e2a\u53d8\u91cf\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u70ed\u56fe\u5219\u9002\u5408\u5c55\u793a\u6570\u636e\u7684\u5bc6\u5ea6\u6216\u76f8\u5173\u6027\u3002\u5982\u679c\u9700\u8981\u6bd4\u8f83\u591a\u4e2a\u7c7b\u522b\u7684\u6570\u636e\uff0c\u67f1\u72b6\u56fe\u6216\u6761\u5f62\u56fe\u662f\u4e0d\u9519\u7684\u9009\u62e9\u3002\u6298\u7ebf\u56fe\u9002\u5408\u5c55\u793a\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u7684\u53d8\u5316\u8d8b\u52bf\u3002\u7406\u89e3\u6570\u636e\u7684\u7279\u70b9\u548c\u5206\u6790\u9700\u6c42\u80fd\u591f\u5e2e\u52a9\u4f60\u505a\u51fa\u66f4\u5408\u9002\u7684\u9009\u62e9\u3002<\/p>\n<p><strong>\u5728\u53ef\u89c6\u5316\u4e2d\u5982\u4f55\u5904\u7406\u7f3a\u5931\u503c\u548c\u5f02\u5e38\u503c\uff1f<\/strong><br \/>\u5904\u7406\u7f3a\u5931\u503c\u548c\u5f02\u5e38\u503c\u662f\u6570\u636e\u53ef\u89c6\u5316\u7684\u91cd\u8981\u6b65\u9aa4\u3002\u5bf9\u4e8e\u7f3a\u5931\u503c\uff0c\u53ef\u4ee5\u9009\u62e9\u5220\u9664\u76f8\u5173\u6570\u636e\u70b9\u3001\u7528\u5747\u503c\u6216\u4e2d\u4f4d\u6570\u8fdb\u884c\u586b\u5145\uff0c\u6216\u8005\u4f7f\u7528\u63d2\u503c\u65b9\u6cd5\u3002\u5f02\u5e38\u503c\u901a\u5e38\u4f1a\u5f71\u54cd\u53ef\u89c6\u5316\u7684\u6548\u679c\uff0c\u53ef\u4ee5\u901a\u8fc7\u6570\u636e\u9884\u5904\u7406\u6b65\u9aa4\u8bc6\u522b\u5e76\u5904\u7406\u8fd9\u4e9b\u503c\uff0c\u6bd4\u5982\u5220\u9664\u3001\u66ff\u6362\u6216\u4f7f\u7528\u7279\u5b9a\u65b9\u6cd5\u8fdb\u884c\u6807\u8bb0\u3002\u5728\u7ed8\u56fe\u65f6\uff0c\u9002\u5f53\u7684\u5904\u7406\u65b9\u5f0f\u80fd\u4f7f\u7ed3\u679c\u66f4\u52a0\u6e05\u6670\u548c\u51c6\u786e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u5c06\u4e8c\u7ef4\u6570\u636e\u96c6\u53ef\u89c6\u5316\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u6709\uff1aMatplotlib\u3001Seaborn\u3001Pand [&hellip;]","protected":false},"author":3,"featured_media":1146132,"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\/1146121"}],"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=1146121"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1146121\/revisions"}],"predecessor-version":[{"id":1146133,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1146121\/revisions\/1146133"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1146132"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1146121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1146121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1146121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}