{"id":1138738,"date":"2025-01-08T22:02:57","date_gmt":"2025-01-08T14:02:57","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1138738.html"},"modified":"2025-01-08T22:03:00","modified_gmt":"2025-01-08T14:03:00","slug":"python%e5%a6%82%e4%bd%95%e7%94%bb%e6%a8%aa%e5%9d%90%e6%a0%87%e4%b8%ba%e6%97%b6%e9%97%b4%e7%9a%84%e6%8a%98%e7%ba%bf%e5%9b%be","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1138738.html","title":{"rendered":"python\u5982\u4f55\u753b\u6a2a\u5750\u6807\u4e3a\u65f6\u95f4\u7684\u6298\u7ebf\u56fe"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25102233\/5cc9259a-9197-4067-beca-a5d817795ebc.webp\" alt=\"python\u5982\u4f55\u753b\u6a2a\u5750\u6807\u4e3a\u65f6\u95f4\u7684\u6298\u7ebf\u56fe\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5de5\u5177\u6765\u7ed8\u5236\u6a2a\u5750\u6807\u4e3a\u65f6\u95f4\u7684\u6298\u7ebf\u56fe<\/strong>\uff0c<strong>\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5de5\u5177\u5305\u62ecMatplotlib\u3001Pandas<\/strong>\u3002\u5176\u4e2d\uff0c<strong>Matplotlib<\/strong> \u662f\u6700\u57fa\u7840\u4e14\u7075\u6d3b\u7684\u7ed8\u56fe\u5de5\u5177\uff0c\u800c <strong>Pandas<\/strong> \u5219\u66f4\u9002\u5408\u7528\u4e8e\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u8fd9\u4e24\u79cd\u5de5\u5177\uff0c\u5206\u522b\u4ecb\u7ecd\u5982\u4f55\u7ed8\u5236\u6a2a\u5750\u6807\u4e3a\u65f6\u95f4\u7684\u6298\u7ebf\u56fe\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528Matplotlib\u7ed8\u5236\u65f6\u95f4\u6298\u7ebf\u56fe<\/h3>\n<\/p>\n<p><h4>1. \u5b89\u88c5\u5e76\u5bfc\u5165\u5fc5\u8981\u7684\u5e93<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86 <code>matplotlib<\/code> \u548c <code>datetime<\/code> \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>pip install pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5bfc\u5165\u5fc5\u8981\u7684\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import pandas as pd<\/p>\n<p>from datetime import datetime<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u521b\u5efa\u793a\u4f8b\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e9b\u793a\u4f8b\u6570\u636e\u3002\u5047\u8bbe\u6211\u4eec\u8981\u7ed8\u5236\u4e00\u5468\u5185\u6bcf\u5929\u7684\u9500\u552e\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u65e5\u671f\u5217\u8868<\/p>\n<p>dates = pd.date_range(start=&#39;2023-01-01&#39;, end=&#39;2023-01-07&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u9500\u552e\u6570\u636e<\/strong><\/h2>\n<p>sales = [150, 200, 250, 300, 350, 400, 450]<\/p>\n<h2><strong>\u521b\u5efaDataFrame<\/strong><\/h2>\n<p>data = pd.DataFrame({&#39;Date&#39;: dates, &#39;Sales&#39;: sales})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u7ed8\u5236\u6298\u7ebf\u56fe<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Matplotlib\u7ed8\u5236\u6298\u7ebf\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">plt.figure(figsize=(10, 6))<\/p>\n<p>plt.plot(data[&#39;Date&#39;], data[&#39;Sales&#39;], marker=&#39;o&#39;, linestyle=&#39;-&#39;)<\/p>\n<p>plt.title(&#39;Sales Over Time&#39;)<\/p>\n<p>plt.xlabel(&#39;Date&#39;)<\/p>\n<p>plt.ylabel(&#39;Sales&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.xticks(rotation=45)  # \u65cb\u8f6c\u65e5\u671f\u6807\u7b7e\u4ee5\u9632\u91cd\u53e0<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528Pandas\u7ed8\u5236\u65f6\u95f4\u6298\u7ebf\u56fe<\/h3>\n<\/p>\n<p><p>Pandas\u53ef\u4ee5\u76f4\u63a5\u7ed8\u5236\u65f6\u95f4\u5e8f\u5217\u6570\u636e\uff0c\u975e\u5e38\u65b9\u4fbf\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5\u5e76\u5bfc\u5165\u5fc5\u8981\u7684\u5e93<\/h4>\n<\/p>\n<p><p>\u4e0eMatplotlib\u76f8\u540c\uff0c\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86 <code>pandas<\/code> \u548c <code>matplotlib<\/code> \u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pandas<\/p>\n<p>pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5bfc\u5165\u5fc5\u8981\u7684\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u521b\u5efa\u793a\u4f8b\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u521b\u5efa\u4e0e\u4e0a\u9762\u76f8\u540c\u7684\u793a\u4f8b\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u65e5\u671f\u5217\u8868<\/p>\n<p>dates = pd.date_range(start=&#39;2023-01-01&#39;, end=&#39;2023-01-07&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u9500\u552e\u6570\u636e<\/strong><\/h2>\n<p>sales = [150, 200, 250, 300, 350, 400, 450]<\/p>\n<h2><strong>\u521b\u5efaDataFrame<\/strong><\/h2>\n<p>data = pd.DataFrame({&#39;Date&#39;: dates, &#39;Sales&#39;: sales})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u7ed8\u5236\u6298\u7ebf\u56fe<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Pandas\u7684\u7ed8\u56fe\u529f\u80fd\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">data.set_index(&#39;Date&#39;, inplace=True)  # \u5c06\u65e5\u671f\u8bbe\u7f6e\u4e3a\u7d22\u5f15<\/p>\n<p>data.plot(figsize=(10, 6), marker=&#39;o&#39;, linestyle=&#39;-&#39;)<\/p>\n<p>plt.title(&#39;Sales Over Time&#39;)<\/p>\n<p>plt.xlabel(&#39;Date&#39;)<\/p>\n<p>plt.ylabel(&#39;Sales&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.xticks(rotation=45)  # \u65cb\u8f6c\u65e5\u671f\u6807\u7b7e\u4ee5\u9632\u91cd\u53e0<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u5904\u7406\u65f6\u95f4\u683c\u5f0f<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u6570\u636e\u5904\u7406\u4e2d\uff0c\u65f6\u95f4\u683c\u5f0f\u53ef\u80fd\u4e0d\u662f\u6807\u51c6\u7684 <code>datetime<\/code> \u683c\u5f0f\uff0c\u6b64\u65f6\u9700\u8981\u8fdb\u884c\u683c\u5f0f\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><h4>1. \u8f6c\u6362\u5b57\u7b26\u4e32\u683c\u5f0f\u7684\u65f6\u95f4<\/h4>\n<\/p>\n<p><p>\u5047\u8bbe\u65e5\u671f\u662f\u5b57\u7b26\u4e32\u683c\u5f0f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u5b57\u7b26\u4e32\u683c\u5f0f\u7684\u65e5\u671f\u5217\u8868<\/p>\n<p>date_strings = [&#39;2023-01-01&#39;, &#39;2023-01-02&#39;, &#39;2023-01-03&#39;, &#39;2023-01-04&#39;, &#39;2023-01-05&#39;, &#39;2023-01-06&#39;, &#39;2023-01-07&#39;]<\/p>\n<h2><strong>\u8f6c\u6362\u4e3adatetime\u683c\u5f0f<\/strong><\/h2>\n<p>dates = [datetime.strptime(date, &#39;%Y-%m-%d&#39;) for date in date_strings]<\/p>\n<h2><strong>\u521b\u5efa\u9500\u552e\u6570\u636e<\/strong><\/h2>\n<p>sales = [150, 200, 250, 300, 350, 400, 450]<\/p>\n<h2><strong>\u521b\u5efaDataFrame<\/strong><\/h2>\n<p>data = pd.DataFrame({&#39;Date&#39;: dates, &#39;Sales&#39;: sales})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u6309\u7167\u4e0a\u9762\u7684\u65b9\u6cd5\u7ed8\u5236\u6298\u7ebf\u56fe\u3002<\/p>\n<\/p>\n<p><h4>2. \u5904\u7406\u5176\u4ed6\u65f6\u95f4\u683c\u5f0f<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u65f6\u95f4\u683c\u5f0f\u590d\u6742\uff0c\u53ef\u4ee5\u4f7f\u7528Pandas\u7684 <code>to_datetime<\/code> \u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">date_strings = [&#39;2023\/01\/01&#39;, &#39;2023\/01\/02&#39;, &#39;2023\/01\/03&#39;, &#39;2023\/01\/04&#39;, &#39;2023\/01\/05&#39;, &#39;2023\/01\/06&#39;, &#39;2023\/01\/07&#39;]<\/p>\n<p>dates = pd.to_datetime(date_strings, format=&#39;%Y\/%m\/%d&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u9500\u552e\u6570\u636e<\/strong><\/h2>\n<p>sales = [150, 200, 250, 300, 350, 400, 450]<\/p>\n<h2><strong>\u521b\u5efaDataFrame<\/strong><\/h2>\n<p>data = pd.DataFrame({&#39;Date&#39;: dates, &#39;Sales&#39;: sales})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u5904\u7406\u7f3a\u5931\u503c<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u6570\u636e\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u7f3a\u5931\u503c\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Pandas\u6765\u5904\u7406\u8fd9\u4e9b\u7f3a\u5931\u503c\u3002<\/p>\n<\/p>\n<p><h4>1. \u63d2\u503c\u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u63d2\u503c\u662f\u4e00\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\u6765\u586b\u8865\u7f3a\u5931\u503c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">data = pd.DataFrame({<\/p>\n<p>    &#39;Date&#39;: pd.date_range(start=&#39;2023-01-01&#39;, end=&#39;2023-01-10&#39;),<\/p>\n<p>    &#39;Sales&#39;: [150, 200, None, 300, None, 400, 450, None, 500, 550]<\/p>\n<p>})<\/p>\n<h2><strong>\u63d2\u503c\u586b\u8865\u7f3a\u5931\u503c<\/strong><\/h2>\n<p>data[&#39;Sales&#39;] = data[&#39;Sales&#39;].interpolate()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u524d\u5411\u586b\u5145\u548c\u540e\u5411\u586b\u5145<\/h4>\n<\/p>\n<p><p>\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f7f\u7528\u524d\u5411\u586b\u5145\u6216\u540e\u5411\u586b\u5145\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">data[&#39;Sales&#39;] = data[&#39;Sales&#39;].ffill()  # \u524d\u5411\u586b\u5145<\/p>\n<h2><strong>\u6216\u8005<\/strong><\/h2>\n<p>data[&#39;Sales&#39;] = data[&#39;Sales&#39;].bfill()  # \u540e\u5411\u586b\u5145<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u4f18\u5316\u56fe\u8868\u5c55\u793a<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u4f7f\u56fe\u8868\u66f4\u5177\u53ef\u8bfb\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u4e00\u4e9b\u4f18\u5316\u5904\u7406\u3002<\/p>\n<\/p>\n<p><h4>1. \u6dfb\u52a0\u7f51\u683c\u7ebf\u548c\u6807\u9898<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">plt.figure(figsize=(10, 6))<\/p>\n<p>plt.plot(data[&#39;Date&#39;], data[&#39;Sales&#39;], marker=&#39;o&#39;, linestyle=&#39;-&#39;)<\/p>\n<p>plt.title(&#39;Sales Over Time&#39;)<\/p>\n<p>plt.xlabel(&#39;Date&#39;)<\/p>\n<p>plt.ylabel(&#39;Sales&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.xticks(rotation=45)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u81ea\u5b9a\u4e49\u65e5\u671f\u683c\u5f0f<\/h4>\n<\/p>\n<p><p>\u6709\u65f6\u6211\u4eec\u9700\u8981\u81ea\u5b9a\u4e49\u65e5\u671f\u683c\u5f0f\u6765\u4f7f\u56fe\u8868\u66f4\u5177\u53ef\u8bfb\u6027\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.dates as mdates<\/p>\n<p>plt.figure(figsize=(10, 6))<\/p>\n<p>plt.plot(data[&#39;Date&#39;], data[&#39;Sales&#39;], marker=&#39;o&#39;, linestyle=&#39;-&#39;)<\/p>\n<p>plt.title(&#39;Sales Over Time&#39;)<\/p>\n<p>plt.xlabel(&#39;Date&#39;)<\/p>\n<p>plt.ylabel(&#39;Sales&#39;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u65e5\u671f\u683c\u5f0f<\/strong><\/h2>\n<p>plt.gca().xaxis.set_major_formatter(mdates.DateFormatter(&#39;%Y-%m-%d&#39;))<\/p>\n<p>plt.gca().xaxis.set_major_locator(mdates.DayLocator(interval=1))<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.xticks(rotation=45)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528Python\u7ed8\u5236\u6a2a\u5750\u6807\u4e3a\u65f6\u95f4\u7684\u6298\u7ebf\u56fe\u662f\u4e00\u4e2a\u975e\u5e38\u5e38\u89c1\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u4f7f\u7528Matplotlib\u548cPandas\u7b49\u5de5\u5177\u8f7b\u677e\u5b9e\u73b0\u3002\u901a\u8fc7\u5b66\u4e60\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u7ed8\u5236\u57fa\u672c\u7684\u6298\u7ebf\u56fe\uff0c\u8fd8\u53ef\u4ee5\u5904\u7406\u65f6\u95f4\u683c\u5f0f\u3001\u7f3a\u5931\u503c\uff0c\u5e76\u4f18\u5316\u56fe\u8868\u7684\u5c55\u793a\u6548\u679c\u3002\u65e0\u8bba\u662f\u6570\u636e\u5206\u6790\u5e08\u8fd8\u662f\u5f00\u53d1\u8005\uff0c\u638c\u63e1\u8fd9\u4e9b\u6280\u5de7\u90fd\u80fd\u63d0\u5347\u6570\u636e\u53ef\u89c6\u5316\u7684\u80fd\u529b\uff0c\u4e3a\u51b3\u7b56\u63d0\u4f9b\u6709\u529b\u652f\u6301\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528Matplotlib\u7ed8\u5236\u65f6\u95f4\u5e8f\u5217\u7684\u6298\u7ebf\u56fe\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528Matplotlib\u5e93\u6765\u7ed8\u5236\u65f6\u95f4\u5e8f\u5217\u7684\u6298\u7ebf\u56fe\u3002\u9996\u5148\uff0c\u786e\u4fdd\u5df2\u5b89\u88c5Matplotlib\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7<code>pip install matplotlib<\/code>\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\u3002\u63a5\u4e0b\u6765\uff0c\u5bfc\u5165\u6240\u9700\u7684\u5e93\u5e76\u4f7f\u7528<code>plot<\/code>\u51fd\u6570\u7ed8\u5236\u6298\u7ebf\u56fe\u3002\u9700\u8981\u5c06\u65f6\u95f4\u6570\u636e\u8f6c\u6362\u4e3a\u5408\u9002\u7684\u683c\u5f0f\uff0c\u4f8b\u5982\u4f7f\u7528<code>pandas.to_datetime<\/code>\u51fd\u6570\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65e5\u671f\u65f6\u95f4\u683c\u5f0f\u3002<\/p>\n<p><strong>\u4f7f\u7528pandas\u5e93\u5904\u7406\u65f6\u95f4\u6570\u636e\u65f6\uff0c\u6709\u54ea\u4e9b\u6ce8\u610f\u4e8b\u9879\uff1f<\/strong><br \/>\u5728\u5904\u7406\u65f6\u95f4\u6570\u636e\u65f6\uff0c\u52a1\u5fc5\u786e\u4fdd\u65f6\u95f4\u683c\u5f0f\u4e00\u81f4\u3002\u53ef\u4ee5\u4f7f\u7528pandas\u5e93\u5c06\u65f6\u95f4\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3adatetime\u5bf9\u8c61\uff0c\u8fd9\u6837\u5728\u7ed8\u56fe\u65f6\u53ef\u4ee5\u907f\u514d\u683c\u5f0f\u4e0d\u5339\u914d\u7684\u95ee\u9898\u3002\u6b64\u5916\uff0cpandas\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u65f6\u95f4\u5e8f\u5217\u529f\u80fd\uff0c\u5982\u91cd\u91c7\u6837\u548c\u65f6\u95f4\u533a\u95f4\u5904\u7406\uff0c\u80fd\u591f\u5e2e\u52a9\u66f4\u597d\u5730\u5904\u7406\u548c\u5206\u6790\u65f6\u95f4\u6570\u636e\u3002<\/p>\n<p><strong>\u5982\u4f55\u81ea\u5b9a\u4e49\u6298\u7ebf\u56fe\u7684\u5916\u89c2\u4ee5\u589e\u5f3a\u53ef\u8bfb\u6027\uff1f<\/strong><br \/>\u5728\u7ed8\u5236\u6298\u7ebf\u56fe\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u7ebf\u6761\u989c\u8272\u3001\u7ebf\u578b\u3001\u6807\u8bb0\u6837\u5f0f\u4ee5\u53ca\u6dfb\u52a0\u7f51\u683c\u7ebf\u6765\u63d0\u9ad8\u56fe\u5f62\u7684\u53ef\u8bfb\u6027\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>plt.plot(x, y, color=&#39;blue&#39;, linestyle=&#39;-&#39;, marker=&#39;o&#39;)<\/code>\u53ef\u4ee5\u81ea\u5b9a\u4e49\u7ebf\u6761\u7684\u989c\u8272\u3001\u6837\u5f0f\u548c\u6807\u8bb0\u3002\u6b64\u5916\uff0c\u6dfb\u52a0\u6807\u9898\u3001\u8f74\u6807\u7b7e\u548c\u56fe\u4f8b\u4e5f\u80fd\u8ba9\u56fe\u8868\u66f4\u5177\u4fe1\u606f\u6027\uff0c\u4f7f\u7528<code>plt.title()<\/code>\u3001<code>plt.xlabel()<\/code>\u548c<code>plt.ylabel()<\/code>\u7b49\u51fd\u6570\u5373\u53ef\u5b9e\u73b0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5de5\u5177\u6765\u7ed8\u5236\u6a2a\u5750\u6807\u4e3a\u65f6\u95f4\u7684\u6298\u7ebf\u56fe\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5de5\u5177\u5305\u62ecMatplotlib\u3001Pan [&hellip;]","protected":false},"author":3,"featured_media":1138746,"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\/1138738"}],"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=1138738"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1138738\/revisions"}],"predecessor-version":[{"id":1138749,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1138738\/revisions\/1138749"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1138746"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1138738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1138738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1138738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}