{"id":1021690,"date":"2024-12-27T13:26:02","date_gmt":"2024-12-27T05:26:02","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1021690.html"},"modified":"2024-12-27T13:26:04","modified_gmt":"2024-12-27T05:26:04","slug":"python-%e5%a6%82%e4%bd%95%e6%98%be%e7%a4%ba%e7%94%bb%e5%9b%be%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1021690.html","title":{"rendered":"python \u5982\u4f55\u663e\u793a\u753b\u56fe\u5de5\u5177"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25164028\/3efef733-cc9c-4c57-832d-23c5417a21dc.webp\" alt=\"python \u5982\u4f55\u663e\u793a\u753b\u56fe\u5de5\u5177\" \/><\/p>\n<p><p> \u8981\u5728Python\u4e2d\u663e\u793a\u753b\u56fe\u5de5\u5177\uff0c\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec<strong>\u4f7f\u7528Matplotlib\u5e93\u3001\u4f7f\u7528Seaborn\u5e93\u3001\u4f7f\u7528Plotly\u5e93\u3001\u4f7f\u7528Bokeh\u5e93<\/strong>\u3002<strong>Matplotlib\u662fPython\u4e2d\u6700\u57fa\u7840\u548c\u6700\u5e7f\u6cdb\u4f7f\u7528\u7684\u7ed8\u56fe\u5e93\u4e4b\u4e00<\/strong>\uff0c\u9002\u5408\u521b\u5efa\u9759\u6001\u3001\u52a8\u6001\u548c\u4ea4\u4e92\u5f0f\u56fe\u8868\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Matplotlib\u6765\u5b9e\u73b0\u56fe\u5f62\u7684\u663e\u793a\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5\u548c\u5bfc\u5165Matplotlib<\/h3>\n<\/p>\n<p><p>Matplotlib\u662f\u4e00\u4e2a\u5f00\u6e90\u7684Python\u7ed8\u56fe\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u751f\u6210\u56fe\u8868\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5Matplotlib\u5e93\u3002\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\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>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u811a\u672c\u6216\u4ea4\u4e92\u5f0f\u73af\u5883\uff08\u5982Jupyter Notebook\uff09\u4e2d\u5bfc\u5165Matplotlib\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>pyplot<\/code>\u662fMatplotlib\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5757\uff0c\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u7528\u4e8e\u521b\u5efa\u56fe\u8868\u7684\u51fd\u6570\uff0c\u7c7b\u4f3c\u4e8eMATLAB\u7684\u7ed8\u56fe\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u521b\u5efa\u57fa\u672c\u56fe\u5f62<\/h3>\n<\/p>\n<p><p><strong>1. \u7ed8\u5236\u7b80\u5355\u6298\u7ebf\u56fe<\/strong><\/p>\n<\/p>\n<p><p>\u6298\u7ebf\u56fe\u662f\u6700\u57fa\u672c\u7684\u56fe\u5f62\u4e4b\u4e00\uff0c\u7528\u4e8e\u663e\u793a\u6570\u636e\u968f\u65f6\u95f4\u6216\u5176\u4ed6\u53d8\u91cf\u7684\u53d8\u5316\u8d8b\u52bf\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u6570\u636e<\/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\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(x, y)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&quot;Simple Line Plot&quot;)<\/p>\n<p>plt.xlabel(&quot;X-axis&quot;)<\/p>\n<p>plt.ylabel(&quot;Y-axis&quot;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>plt.plot(x, y)<\/code>\u7528\u4e8e\u7ed8\u5236\u6298\u7ebf\u56fe\uff0c<code>plt.title<\/code>\u3001<code>plt.xlabel<\/code>\u548c<code>plt.ylabel<\/code>\u7528\u4e8e\u6dfb\u52a0\u6807\u9898\u548c\u5750\u6807\u8f74\u6807\u7b7e\uff0c<code>plt.show()<\/code>\u7528\u4e8e\u663e\u793a\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><p><strong>2. \u7ed8\u5236\u6563\u70b9\u56fe<\/strong><\/p>\n<\/p>\n<p><p>\u6563\u70b9\u56fe\u7528\u4e8e\u663e\u793a\u4e24\u4e2a\u53d8\u91cf\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u6570\u636e<\/strong><\/h2>\n<p>x = [5, 7, 8, 5, 6, 7, 9, 2, 3, 4, 4, 4, 4, 7, 8, 9, 5, 6, 7]<\/p>\n<p>y = [7, 4, 3, 9, 1, 3, 2, 6, 3, 8, 1, 9, 6, 4, 9, 2, 3, 2, 6]<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe<\/strong><\/h2>\n<p>plt.scatter(x, y, label=&#39;skitscat&#39;, color=&#39;r&#39;, s=25, marker=&quot;o&quot;)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u9898\u548c\u6807\u7b7e<\/strong><\/h2>\n<p>plt.title(&quot;Simple Scatter Plot&quot;)<\/p>\n<p>plt.xlabel(&quot;X-axis&quot;)<\/p>\n<p>plt.ylabel(&quot;Y-axis&quot;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>plt.scatter(x, y)<\/code>\u7528\u4e8e\u7ed8\u5236\u6563\u70b9\u56fe\uff0c\u5176\u4e2d<code>label<\/code>\u7528\u4e8e\u6dfb\u52a0\u56fe\u4f8b\u6807\u7b7e\uff0c<code>color<\/code>\u3001<code>s<\/code>\u548c<code>marker<\/code>\u7528\u4e8e\u8bbe\u7f6e\u989c\u8272\u3001\u70b9\u7684\u5927\u5c0f\u548c\u5f62\u72b6\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u5b9a\u5236\u56fe\u5f62<\/h3>\n<\/p>\n<p><p><strong>1. \u4fee\u6539\u56fe\u5f62\u6837\u5f0f<\/strong><\/p>\n<\/p>\n<p><p>Matplotlib\u63d0\u4f9b\u4e86\u591a\u79cd\u6837\u5f0f\uff0c\u53ef\u4ee5\u901a\u8fc7<code>plt.style.use()<\/code>\u51fd\u6570\u6765\u6539\u53d8\u56fe\u5f62\u7684\u5916\u89c2\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u4f7f\u7528\u6837\u5f0f<\/strong><\/h2>\n<p>plt.style.use(&#39;ggplot&#39;)<\/p>\n<h2><strong>\u6570\u636e<\/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\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(x, y)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u4e86<code>ggplot<\/code>\u6837\u5f0f\uff0c\u8fd9\u662f\u4e00\u79cd\u6d41\u884c\u7684\u56fe\u5f62\u6837\u5f0f\uff0c\u6a21\u4eff\u4e86R\u8bed\u8a00\u4e2d\u7684ggplot2\u5305\u3002<\/p>\n<\/p>\n<p><p><strong>2. \u6dfb\u52a0\u56fe\u4f8b<\/strong><\/p>\n<\/p>\n<p><p>\u56fe\u4f8b\u7528\u4e8e\u63cf\u8ff0\u56fe\u5f62\u4e2d\u5404\u5143\u7d20\u7684\u542b\u4e49\uff0c\u53ef\u4ee5\u901a\u8fc7<code>plt.legend()<\/code>\u51fd\u6570\u6765\u6dfb\u52a0\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u6570\u636e<\/strong><\/h2>\n<p>x = [1, 2, 3, 4, 5]<\/p>\n<p>y1 = [2, 3, 5, 7, 11]<\/p>\n<p>y2 = [1, 4, 6, 8, 10]<\/p>\n<h2><strong>\u7ed8\u5236\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(x, y1, label=&#39;Series 1&#39;)<\/p>\n<p>plt.plot(x, y2, label=&#39;Series 2&#39;)<\/p>\n<h2><strong>\u6dfb\u52a0\u56fe\u4f8b<\/strong><\/h2>\n<p>plt.legend()<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u7ed8\u5236\u4e86\u4e24\u4e2a\u6570\u636e\u7cfb\u5217\uff0c\u5e76\u901a\u8fc7<code>plt.legend()<\/code>\u6dfb\u52a0\u4e86\u56fe\u4f8b\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4fdd\u5b58\u56fe\u5f62<\/h3>\n<\/p>\n<p><p>Matplotlib\u5141\u8bb8\u5c06\u56fe\u5f62\u4fdd\u5b58\u4e3a\u591a\u79cd\u683c\u5f0f\u7684\u6587\u4ef6\uff0c\u4f8b\u5982PNG\u3001PDF\u3001SVG\u7b49\u3002\u53ef\u4ee5\u4f7f\u7528<code>plt.savefig()<\/code>\u51fd\u6570\u6765\u5b9e\u73b0\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u6570\u636e<\/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\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(x, y)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u5f62<\/strong><\/h2>\n<p>plt.savefig(&#39;line_plot.png&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u5c06\u56fe\u5f62\u4fdd\u5b58\u4e3a<code>line_plot.png<\/code>\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528Jupyter Notebook\u4e2d\u7684Matplotlib<\/h3>\n<\/p>\n<p><p>\u5728Jupyter Notebook\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>%matplotlib inline<\/code>\u547d\u4ee4\u5728\u7b14\u8bb0\u672c\u7684\u8f93\u51fa\u5355\u5143\u4e2d\u76f4\u63a5\u663e\u793a\u56fe\u5f62\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u5728Jupyter Notebook\u4e2d\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>%matplotlib inline<\/p>\n<h2><strong>\u6570\u636e<\/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\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(x, y)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4f7f\u5f97\u5728Jupyter Notebook\u4e2d\u4f7f\u7528Matplotlib\u53d8\u5f97\u66f4\u52a0\u65b9\u4fbf\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528\u5176\u4ed6\u7ed8\u56fe\u5e93<\/h3>\n<\/p>\n<p><p>\u9664\u4e86Matplotlib\uff0c\u8fd8\u6709\u5176\u4ed6\u4e00\u4e9b\u6d41\u884c\u7684Python\u7ed8\u56fe\u5e93\uff0c\u5982Seaborn\u3001Plotly\u548cBokeh\u3002\u5b83\u4eec\u63d0\u4f9b\u4e86\u4e0d\u540c\u7684\u529f\u80fd\u548c\u98ce\u683c\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u9009\u62e9\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><p><strong>1. Seaborn<\/strong><\/p>\n<\/p>\n<p><p>Seaborn\u662f\u57fa\u4e8eMatplotlib\u7684\u9ad8\u7ea7\u7ed8\u56fe\u5e93\uff0c\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7ea7\u7684\u63a5\u53e3\u548c\u66f4\u7f8e\u89c2\u7684\u56fe\u5f62\u6837\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install seaborn<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e00\u4e2a\u7b80\u5355\u7684Seaborn\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import seaborn as sns<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u6570\u636e<\/strong><\/h2>\n<p>tips = sns.load_dataset(&quot;tips&quot;)<\/p>\n<h2><strong>\u7ed8\u5236\u7bb1\u7ebf\u56fe<\/strong><\/h2>\n<p>sns.boxplot(x=&quot;day&quot;, y=&quot;total_bill&quot;, data=tips)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>2. Plotly<\/strong><\/p>\n<\/p>\n<p><p>Plotly\u662f\u4e00\u4e2a\u7528\u4e8e\u521b\u5efa\u4ea4\u4e92\u5f0f\u56fe\u5f62\u7684\u5e93\uff0c\u652f\u6301\u591a\u79cd\u8f93\u51fa\u683c\u5f0f\uff0c\u5305\u62ecHTML\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install plotly<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e00\u4e2a\u7b80\u5355\u7684Plotly\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import plotly.express as px<\/p>\n<h2><strong>\u6570\u636e<\/strong><\/h2>\n<p>df = px.data.iris()<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe<\/strong><\/h2>\n<p>fig = px.scatter(df, x=&quot;sepal_width&quot;, y=&quot;sepal_length&quot;, color=&quot;species&quot;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>fig.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>3. Bokeh<\/strong><\/p>\n<\/p>\n<p><p>Bokeh\u4e5f\u662f\u4e00\u4e2a\u7528\u4e8e\u521b\u5efa\u4ea4\u4e92\u5f0f\u56fe\u5f62\u7684\u5e93\uff0c\u652f\u6301\u6d4f\u89c8\u5668\u663e\u793a\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install bokeh<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e00\u4e2a\u7b80\u5355\u7684Bokeh\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bokeh.plotting import figure, show, output_file<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62\u5bf9\u8c61<\/strong><\/h2>\n<p>p = figure(title=&quot;Simple Line Plot&quot;, x_axis_label=&#39;x&#39;, y_axis_label=&#39;y&#39;)<\/p>\n<h2><strong>\u6dfb\u52a0\u4e00\u6761\u7ebf<\/strong><\/h2>\n<p>p.line([1, 2, 3, 4, 5], [2, 3, 5, 7, 11], legend_label=&quot;Temp.&quot;, line_width=2)<\/p>\n<h2><strong>\u8f93\u51fa\u5230HTML\u6587\u4ef6<\/strong><\/h2>\n<p>output_file(&quot;line.html&quot;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>show(p)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u663e\u793a\u753b\u56fe\u5de5\u5177\u7684\u5e38\u7528\u65b9\u6cd5\u662f\u4f7f\u7528Matplotlib\u5e93\u3002Matplotlib\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u7ed8\u5236\u5404\u79cd\u7c7b\u578b\u7684\u56fe\u5f62\uff0c\u5e76\u652f\u6301\u5b9a\u5236\u5316\u548c\u4fdd\u5b58\u56fe\u5f62\u3002\u5bf9\u4e8e\u9700\u8981\u66f4\u9ad8\u7ea7\u529f\u80fd\u6216\u4ea4\u4e92\u5f0f\u56fe\u5f62\u7684\u573a\u666f\uff0c\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528Seaborn\u3001Plotly\u6216Bokeh\u7b49\u5e93\u3002\u6bcf\u4e2a\u5e93\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u70b9\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u9009\u62e9\u548c\u4f7f\u7528\u3002\u901a\u8fc7\u638c\u63e1\u8fd9\u4e9b\u5de5\u5177\uff0c\u53ef\u4ee5\u5728\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u4e2d\u66f4\u597d\u5730\u5c55\u793a\u6570\u636e\u7684\u4ef7\u503c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u9009\u62e9\u5408\u9002\u7684\u7ed8\u56fe\u5de5\u5177\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u6709\u591a\u79cd\u7ed8\u56fe\u5de5\u5177\u53ef\u4f9b\u9009\u62e9\uff0c\u5305\u62ecMatplotlib\u3001Seaborn\u3001Plotly\u7b49\u3002\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u53d6\u51b3\u4e8e\u60a8\u5177\u4f53\u7684\u9700\u6c42\u3002\u4f8b\u5982\uff0cMatplotlib\u9002\u7528\u4e8e\u57fa\u672c\u56fe\u8868\u548c\u5b9a\u5236\u5316\u9700\u6c42\uff0c\u800cSeaborn\u5219\u66f4\u9002\u5408\u7edf\u8ba1\u56fe\u8868\uff0cPlotly\u5219\u63d0\u4f9b\u4e92\u52a8\u6027\u66f4\u5f3a\u7684\u56fe\u8868\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u9879\u76ee\u7684\u590d\u6742\u6027\u548c\u6570\u636e\u53ef\u89c6\u5316\u7684\u8981\u6c42\u6765\u505a\u51fa\u9009\u62e9\u3002<\/p>\n<p><strong>\u5728\u4f7f\u7528Python\u7ed8\u56fe\u65f6\u5982\u4f55\u5904\u7406\u6570\u636e\uff1f<\/strong><br \/>\u5728\u7ed8\u56fe\u4e4b\u524d\uff0c\u786e\u4fdd\u6570\u636e\u5df2\u88ab\u6e05\u6d17\u548c\u6574\u7406\u3002\u5e38\u89c1\u7684\u5904\u7406\u6b65\u9aa4\u5305\u62ec\u53bb\u9664\u7f3a\u5931\u503c\u3001\u8f6c\u6362\u6570\u636e\u7c7b\u578b\u4ee5\u53ca\u5f52\u4e00\u5316\u7b49\u3002\u4f7f\u7528Pandas\u5e93\u53ef\u4ee5\u8f7b\u677e\u5730\u5bf9\u6570\u636e\u8fdb\u884c\u64cd\u4f5c\uff0c\u786e\u4fdd\u6570\u636e\u6846\u67b6\u9002\u5408\u7ed8\u56fe\u9700\u6c42\u3002\u5904\u7406\u597d\u7684\u6570\u636e\u5c06\u4f7f\u5f97\u7ed8\u56fe\u66f4\u52a0\u51c6\u786e\u548c\u7f8e\u89c2\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u81ea\u5b9a\u4e49\u56fe\u8868\u7684\u6837\u5f0f\u548c\u5916\u89c2\uff1f<\/strong><br \/>\u901a\u8fc7\u4f7f\u7528Matplotlib\u6216Seaborn\u7b49\u5e93\uff0c\u60a8\u53ef\u4ee5\u81ea\u5b9a\u4e49\u56fe\u8868\u7684\u989c\u8272\u3001\u5b57\u4f53\u3001\u7ebf\u578b\u548c\u6807\u8bb0\u7b49\u5c5e\u6027\u3002Matplotlib\u5141\u8bb8\u60a8\u8bbe\u7f6e\u56fe\u8868\u7684\u6807\u9898\u3001\u5750\u6807\u8f74\u6807\u7b7e\u53ca\u523b\u5ea6\uff0c\u4ece\u800c\u4f7f\u56fe\u8868\u66f4\u52a0\u7b26\u5408\u60a8\u7684\u54c1\u724c\u6216\u9879\u76ee\u9700\u6c42\u3002\u6b64\u5916\uff0cSeaborn\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5185\u7f6e\u7684\u4e3b\u9898\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u4e3b\u9898\u5feb\u901f\u8c03\u6574\u56fe\u8868\u7684\u6574\u4f53\u5916\u89c2\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u663e\u793a\u753b\u56fe\u5de5\u5177\uff0c\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528Matplotlib\u5e93\u3001\u4f7f\u7528Seaborn\u5e93\u3001\u4f7f\u7528Plotl [&hellip;]","protected":false},"author":3,"featured_media":1021700,"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\/1021690"}],"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=1021690"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1021690\/revisions"}],"predecessor-version":[{"id":1021702,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1021690\/revisions\/1021702"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1021700"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1021690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1021690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1021690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}