{"id":1169122,"date":"2025-01-15T16:06:48","date_gmt":"2025-01-15T08:06:48","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1169122.html"},"modified":"2025-01-15T16:06:51","modified_gmt":"2025-01-15T08:06:51","slug":"python%e8%af%ad%e8%a8%80%e5%a6%82%e4%bd%95%e5%a1%ab%e5%85%85%e8%89%b2-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1169122.html","title":{"rendered":"python\u8bed\u8a00\u5982\u4f55\u586b\u5145\u8272"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26070140\/31ef986d-9d67-4ee6-af97-989dc3a040ac.webp\" alt=\"python\u8bed\u8a00\u5982\u4f55\u586b\u5145\u8272\" \/><\/p>\n<p><p> <strong>Python\u8bed\u8a00\u586b\u5145\u8272\u7684\u4e3b\u8981\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528matplotlib\u5e93\u586b\u5145\u56fe\u5f62\u989c\u8272\u3001\u4f7f\u7528Pillow\u5e93\u586b\u5145\u56fe\u50cf\u989c\u8272\u3001\u4f7f\u7528Tkinter\u5e93\u586b\u5145GUI\u7ec4\u4ef6\u989c\u8272<\/strong>\u3002\u5176\u4e2d\uff0c\u4f7f\u7528matplotlib\u5e93\u586b\u5145\u56fe\u5f62\u989c\u8272\u662f\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\uff0c\u9002\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\u548c\u56fe\u5f62\u7ed8\u5236\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528matplotlib\u5e93\u586b\u5145\u56fe\u5f62\u989c\u8272\u3002<\/p>\n<\/p>\n<p><p><strong>Matplotlib\u5e93\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\uff0c\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u7ed8\u56fe\u5de5\u5177\u4e4b\u4e00\u3002\u901a\u8fc7\u8bbe\u7f6e\u56fe\u5f62\u7684\u989c\u8272\u5c5e\u6027\uff0c\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u56fe\u5f62\u7684\u586b\u5145\u8272\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u6765\u8bf4\u660e\u5982\u4f55\u4f7f\u7528matplotlib\u5e93\u586b\u5145\u56fe\u5f62\u989c\u8272\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u6b63\u5f26\u6ce2\u56fe\u5f62<\/strong><\/h2>\n<p>import numpy as np<\/p>\n<p>x = np.linspace(0, 10, 100)<\/p>\n<p>y = np.sin(x)<\/p>\n<h2><strong>\u7ed8\u5236\u6b63\u5f26\u6ce2\u56fe\u5f62\u5e76\u586b\u5145\u989c\u8272<\/strong><\/h2>\n<p>plt.plot(x, y)<\/p>\n<p>plt.fill_between(x, y, color=&#39;skyblue&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165matplotlib.pyplot\u6a21\u5757\uff0c\u7136\u540e\u751f\u6210\u4e00\u4e2a\u7b80\u5355\u7684\u6b63\u5f26\u6ce2\u56fe\u5f62\u3002\u901a\u8fc7\u4f7f\u7528<code>fill_between<\/code>\u51fd\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u586b\u5145\u56fe\u5f62\u7684\u989c\u8272\uff0c\u5176\u4e2d<code>color<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u586b\u5145\u7684\u989c\u8272\u3002\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9009\u62e9\u4e86&quot;skyblue&quot;\u4f5c\u4e3a\u586b\u5145\u989c\u8272\u3002\u6700\u7ec8\uff0c\u901a\u8fc7<code>plt.show()<\/code>\u51fd\u6570\u663e\u793a\u586b\u5145\u989c\u8272\u540e\u7684\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u63a2\u8ba8Python\u4e2d\u4e0d\u540c\u5e93\u586b\u5145\u989c\u8272\u7684\u5404\u79cd\u65b9\u6cd5\u548c\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001MATPLOTLIB\u5e93\u7684\u586b\u5145\u8272\u65b9\u6cd5<\/h2>\n<\/p>\n<p><h3>1\u3001\u57fa\u672c\u586b\u5145\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>Matplotlib\u5e93\u63d0\u4f9b\u4e86\u591a\u79cd\u586b\u5145\u56fe\u5f62\u989c\u8272\u7684\u65b9\u6cd5\uff0c\u5305\u62ec<code>fill_between<\/code>\u3001<code>fill<\/code>\u548c<code>contourf<\/code>\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u586b\u5145\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528fill_between\u586b\u5145\u989c\u8272<\/h4>\n<\/p>\n<p><p><code>fill_between<\/code>\u51fd\u6570\u7528\u4e8e\u5728\u4e24\u4e2a\u66f2\u7ebf\u4e4b\u95f4\u586b\u5145\u989c\u8272\uff0c\u5e38\u7528\u4e8e\u7ed8\u5236\u9762\u79ef\u56fe\u548c\u533a\u57df\u56fe\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<p>x = np.linspace(0, 10, 100)<\/p>\n<p>y1 = np.sin(x)<\/p>\n<p>y2 = np.cos(x)<\/p>\n<p>plt.plot(x, y1, label=&#39;sin(x)&#39;)<\/p>\n<p>plt.plot(x, y2, label=&#39;cos(x)&#39;)<\/p>\n<p>plt.fill_between(x, y1, y2, color=&#39;lightgreen&#39;, alpha=0.5)<\/p>\n<p>plt.legend()<\/p>\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\u6b63\u5f26\u6ce2\u548c\u4f59\u5f26\u6ce2\uff0c\u5e76\u4f7f\u7528<code>fill_between<\/code>\u51fd\u6570\u5728\u4e24\u6761\u66f2\u7ebf\u4e4b\u95f4\u586b\u5145\u989c\u8272\u3002<code>alpha<\/code>\u53c2\u6570\u7528\u4e8e\u8bbe\u7f6e\u586b\u5145\u989c\u8272\u7684\u900f\u660e\u5ea6\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528fill\u586b\u5145\u989c\u8272<\/h4>\n<\/p>\n<p><p><code>fill<\/code>\u51fd\u6570\u7528\u4e8e\u586b\u5145\u591a\u8fb9\u5f62\u7684\u989c\u8272\uff0c\u9002\u7528\u4e8e\u7ed8\u5236\u591a\u8fb9\u5f62\u548c\u95ed\u5408\u533a\u57df\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>x = [1, 2, 3, 4, 5]<\/p>\n<p>y = [1, 4, 2, 5, 3]<\/p>\n<p>plt.fill(x, y, color=&#39;orange&#39;, alpha=0.7)<\/p>\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<code>fill<\/code>\u51fd\u6570\u586b\u5145\u4e00\u4e2a\u591a\u8fb9\u5f62\u7684\u989c\u8272\uff0c<code>color<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u586b\u5145\u7684\u989c\u8272\uff0c<code>alpha<\/code>\u53c2\u6570\u7528\u4e8e\u8bbe\u7f6e\u900f\u660e\u5ea6\u3002<\/p>\n<\/p>\n<p><h3>2\u3001\u4f7f\u7528contourf\u51fd\u6570\u586b\u5145\u989c\u8272<\/h3>\n<\/p>\n<p><p><code>contourf<\/code>\u51fd\u6570\u7528\u4e8e\u7ed8\u5236\u7b49\u9ad8\u7ebf\u56fe\uff0c\u5e76\u5728\u7b49\u9ad8\u7ebf\u4e4b\u95f4\u586b\u5145\u989c\u8272\u3002\u5e38\u7528\u4e8e\u5730\u7406\u6570\u636e\u53ef\u89c6\u5316\u548c\u4e09\u7ef4\u6570\u636e\u7684\u7b49\u9ad8\u7ebf\u8868\u793a\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<p>x = np.linspace(-5, 5, 100)<\/p>\n<p>y = np.linspace(-5, 5, 100)<\/p>\n<p>X, Y = np.meshgrid(x, y)<\/p>\n<p>Z = np.sin(np.sqrt(X&lt;strong&gt;2 + Y&lt;\/strong&gt;2))<\/p>\n<p>plt.contourf(X, Y, Z, cmap=&#39;viridis&#39;)<\/p>\n<p>plt.colorbar()<\/p>\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<code>contourf<\/code>\u51fd\u6570\u7ed8\u5236\u4e86\u4e00\u4e2a\u7b49\u9ad8\u7ebf\u56fe\uff0c\u5e76\u5728\u7b49\u9ad8\u7ebf\u4e4b\u95f4\u586b\u5145\u989c\u8272\u3002<code>cmap<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u989c\u8272\u6620\u5c04\uff0c<code>colorbar<\/code>\u51fd\u6570\u7528\u4e8e\u663e\u793a\u989c\u8272\u6761\u3002<\/p>\n<\/p>\n<p><h3>3\u3001\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04<\/h3>\n<\/p>\n<p><p>Matplotlib\u5e93\u5141\u8bb8\u7528\u6237\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04\uff0c\u4ee5\u6ee1\u8db3\u7279\u5b9a\u7684\u53ef\u89c6\u5316\u9700\u6c42\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<p>from matplotlib.colors import LinearSegmentedColormap<\/p>\n<p>x = np.linspace(-5, 5, 100)<\/p>\n<p>y = np.linspace(-5, 5, 100)<\/p>\n<p>X, Y = np.meshgrid(x, y)<\/p>\n<p>Z = np.sin(np.sqrt(X&lt;strong&gt;2 + Y&lt;\/strong&gt;2))<\/p>\n<h2><strong>\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04<\/strong><\/h2>\n<p>colors = [(0, 0, 1), (0, 1, 0), (1, 0, 0)]  # \u84dd\u8272\u5230\u7eff\u8272\u5230\u7ea2\u8272<\/p>\n<p>cm = LinearSegmentedColormap.from_list(&#39;custom_cmap&#39;, colors, N=256)<\/p>\n<p>plt.contourf(X, Y, Z, cmap=cm)<\/p>\n<p>plt.colorbar()<\/p>\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<code>LinearSegmentedColormap<\/code>\u7c7b\u81ea\u5b9a\u4e49\u4e86\u4e00\u4e2a\u989c\u8272\u6620\u5c04\uff0c\u4ece\u84dd\u8272\u5230\u7eff\u8272\u518d\u5230\u7ea2\u8272\u3002\u7136\u540e\u5728<code>contourf<\/code>\u51fd\u6570\u4e2d\u4f7f\u7528\u8fd9\u4e2a\u81ea\u5b9a\u4e49\u7684\u989c\u8272\u6620\u5c04\u6765\u586b\u5145\u7b49\u9ad8\u7ebf\u56fe\u7684\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h2>\u4e8c\u3001PILLOW\u5e93\u7684\u586b\u5145\u8272\u65b9\u6cd5<\/h2>\n<\/p>\n<p><h3>1\u3001\u57fa\u672c\u586b\u5145\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>Pillow\u5e93\uff08\u539fPIL\u5e93\uff09\u662fPython\u4e2d\u7528\u4e8e\u56fe\u50cf\u5904\u7406\u7684\u5e93\uff0c\u63d0\u4f9b\u4e86\u591a\u79cd\u586b\u5145\u56fe\u50cf\u989c\u8272\u7684\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u586b\u5145\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528ImageDraw\u6a21\u5757\u586b\u5145\u989c\u8272<\/h4>\n<\/p>\n<p><p>Pillow\u5e93\u4e2d\u7684ImageDraw\u6a21\u5757\u63d0\u4f9b\u4e86\u7ed8\u5236\u548c\u586b\u5145\u56fe\u5f62\u7684\u529f\u80fd\uff0c\u5305\u62ec\u77e9\u5f62\u3001\u5706\u5f62\u3001\u591a\u8fb9\u5f62\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image, ImageDraw<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u7a7a\u767d\u56fe\u50cf<\/strong><\/h2>\n<p>image = Image.new(&#39;RGB&#39;, (200, 200), &#39;white&#39;)<\/p>\n<p>draw = ImageDraw.Draw(image)<\/p>\n<h2><strong>\u7ed8\u5236\u5e76\u586b\u5145\u77e9\u5f62<\/strong><\/h2>\n<p>draw.rectangle([50, 50, 150, 150], fill=&#39;blue&#39;)<\/p>\n<h2><strong>\u7ed8\u5236\u5e76\u586b\u5145\u5706\u5f62<\/strong><\/h2>\n<p>draw.ellipse([50, 50, 150, 150], fill=&#39;red&#39;)<\/p>\n<p>image.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u7a7a\u767d\u56fe\u50cf\uff0c\u5e76\u4f7f\u7528<code>ImageDraw.Draw<\/code>\u5bf9\u8c61\u7ed8\u5236\u5e76\u586b\u5145\u77e9\u5f62\u548c\u5706\u5f62\u3002<code>fill<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u586b\u5145\u7684\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528Image\u6a21\u5757\u586b\u5145\u989c\u8272<\/h4>\n<\/p>\n<p><p>Pillow\u5e93\u4e2d\u7684Image\u6a21\u5757\u63d0\u4f9b\u4e86\u76f4\u63a5\u586b\u5145\u56fe\u50cf\u989c\u8272\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u586b\u5145\u6574\u4e2a\u56fe\u50cf\u548c\u586b\u5145\u7279\u5b9a\u533a\u57df\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u7a7a\u767d\u56fe\u50cf<\/strong><\/h2>\n<p>image = Image.new(&#39;RGB&#39;, (200, 200), &#39;white&#39;)<\/p>\n<h2><strong>\u586b\u5145\u6574\u4e2a\u56fe\u50cf\u989c\u8272<\/strong><\/h2>\n<p>image.paste(&#39;yellow&#39;, [0, 0, 200, 200])<\/p>\n<p>image.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u7a7a\u767d\u56fe\u50cf\uff0c\u5e76\u4f7f\u7528<code>paste<\/code>\u65b9\u6cd5\u586b\u5145\u6574\u4e2a\u56fe\u50cf\u7684\u989c\u8272\u3002<code>paste<\/code>\u65b9\u6cd5\u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u586b\u5145\u7684\u533a\u57df\u3002<\/p>\n<\/p>\n<p><h3>2\u3001\u6e10\u53d8\u586b\u5145<\/h3>\n<\/p>\n<p><p>Pillow\u5e93\u8fd8\u63d0\u4f9b\u4e86\u6e10\u53d8\u586b\u5145\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7\u9010\u6b65\u6539\u53d8\u989c\u8272\u503c\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u7a7a\u767d\u56fe\u50cf<\/strong><\/h2>\n<p>width, height = 200, 200<\/p>\n<p>image = Image.new(&#39;RGB&#39;, (width, height))<\/p>\n<h2><strong>\u6e10\u53d8\u586b\u5145<\/strong><\/h2>\n<p>for i in range(width):<\/p>\n<p>    for j in range(height):<\/p>\n<p>        color = (i % 256, j % 256, (i + j) % 256)<\/p>\n<p>        image.putpixel((i, j), color)<\/p>\n<p>image.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u7a7a\u767d\u56fe\u50cf\uff0c\u5e76\u4f7f\u7528<code>putpixel<\/code>\u65b9\u6cd5\u9010\u50cf\u7d20\u586b\u5145\u989c\u8272\uff0c\u5b9e\u73b0\u6e10\u53d8\u6548\u679c\u3002\u989c\u8272\u503c\u6839\u636e\u50cf\u7d20\u4f4d\u7f6e\u53d8\u5316\uff0c\u5b9e\u73b0\u4ece\u5de6\u4e0a\u89d2\u5230\u53f3\u4e0b\u89d2\u7684\u6e10\u53d8\u586b\u5145\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001TKINTER\u5e93\u7684\u586b\u5145\u8272\u65b9\u6cd5<\/h2>\n<\/p>\n<p><h3>1\u3001\u57fa\u672c\u586b\u5145\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>Tkinter\u5e93\u662fPython\u7684\u6807\u51c6GUI\u5e93\uff0c\u63d0\u4f9b\u4e86\u586b\u5145GUI\u7ec4\u4ef6\u989c\u8272\u7684\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u586b\u5145\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>\u586b\u5145\u7a97\u53e3\u80cc\u666f\u989c\u8272<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import tkinter as tk<\/p>\n<h2><strong>\u521b\u5efa\u4e3b\u7a97\u53e3<\/strong><\/h2>\n<p>root = tk.Tk()<\/p>\n<p>root.geometry(&#39;400x300&#39;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u7a97\u53e3\u80cc\u666f\u989c\u8272<\/strong><\/h2>\n<p>root.configure(bg=&#39;lightblue&#39;)<\/p>\n<p>root.m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>nloop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2aTkinter\u4e3b\u7a97\u53e3\uff0c\u5e76\u4f7f\u7528<code>configure<\/code>\u65b9\u6cd5\u8bbe\u7f6e\u7a97\u53e3\u7684\u80cc\u666f\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h4>\u586b\u5145\u7ec4\u4ef6\u80cc\u666f\u989c\u8272<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import tkinter as tk<\/p>\n<h2><strong>\u521b\u5efa\u4e3b\u7a97\u53e3<\/strong><\/h2>\n<p>root = tk.Tk()<\/p>\n<p>root.geometry(&#39;400x300&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u6807\u7b7e\u5e76\u8bbe\u7f6e\u80cc\u666f\u989c\u8272<\/strong><\/h2>\n<p>label = tk.Label(root, text=&#39;Hello, Tkinter!&#39;, bg=&#39;yellow&#39;)<\/p>\n<p>label.pack(pady=20)<\/p>\n<p>root.mainloop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2aTkinter\u6807\u7b7e\u7ec4\u4ef6\uff0c\u5e76\u4f7f\u7528<code>bg<\/code>\u53c2\u6570\u8bbe\u7f6e\u6807\u7b7e\u7684\u80cc\u666f\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h3>2\u3001\u586b\u5145Canvas\u7ec4\u4ef6\u989c\u8272<\/h3>\n<\/p>\n<p><p>Tkinter\u7684Canvas\u7ec4\u4ef6\u7528\u4e8e\u7ed8\u5236\u56fe\u5f62\u548c\u586b\u5145\u989c\u8272\uff0c\u9002\u7528\u4e8e\u7ed8\u5236\u590d\u6742\u56fe\u5f62\u548c\u81ea\u5b9a\u4e49\u7ed8\u56fe\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import tkinter as tk<\/p>\n<h2><strong>\u521b\u5efa\u4e3b\u7a97\u53e3<\/strong><\/h2>\n<p>root = tk.Tk()<\/p>\n<p>root.geometry(&#39;400x300&#39;)<\/p>\n<h2><strong>\u521b\u5efaCanvas\u7ec4\u4ef6<\/strong><\/h2>\n<p>canvas = tk.Canvas(root, width=300, height=200, bg=&#39;white&#39;)<\/p>\n<p>canvas.pack(pady=20)<\/p>\n<h2><strong>\u7ed8\u5236\u5e76\u586b\u5145\u77e9\u5f62<\/strong><\/h2>\n<p>canvas.create_rectangle(50, 50, 250, 150, fill=&#39;blue&#39;)<\/p>\n<h2><strong>\u7ed8\u5236\u5e76\u586b\u5145\u5706\u5f62<\/strong><\/h2>\n<p>canvas.create_oval(50, 50, 250, 150, fill=&#39;red&#39;)<\/p>\n<p>root.mainloop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2aTkinter Canvas\u7ec4\u4ef6\uff0c\u5e76\u4f7f\u7528<code>create_rectangle<\/code>\u548c<code>create_oval<\/code>\u65b9\u6cd5\u7ed8\u5236\u5e76\u586b\u5145\u77e9\u5f62\u548c\u5706\u5f62\u3002<code>fill<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u586b\u5145\u7684\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001SEABORN\u5e93\u7684\u586b\u5145\u8272\u65b9\u6cd5<\/h2>\n<\/p>\n<p><h3>1\u3001\u57fa\u672c\u586b\u5145\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>Seaborn\u5e93\u662f\u57fa\u4e8eMatplotlib\u7684\u9ad8\u7ea7\u6570\u636e\u53ef\u89c6\u5316\u5e93\uff0c\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7b80\u6d01\u6613\u7528\u7684\u63a5\u53e3\u548c\u7f8e\u89c2\u7684\u9ed8\u8ba4\u6837\u5f0f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u586b\u5145\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>\u586b\u5145\u67f1\u72b6\u56fe\u989c\u8272<\/h4>\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>\u751f\u6210\u793a\u4f8b\u6570\u636e<\/strong><\/h2>\n<p>data = sns.load_dataset(&#39;tips&#39;)<\/p>\n<h2><strong>\u7ed8\u5236\u67f1\u72b6\u56fe\u5e76\u586b\u5145\u989c\u8272<\/strong><\/h2>\n<p>sns.barplot(x=&#39;day&#39;, y=&#39;total_bill&#39;, data=data, palette=&#39;Blues&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528Seaborn\u5e93\u52a0\u8f7d\u793a\u4f8b\u6570\u636e\uff0c\u5e76\u4f7f\u7528<code>barplot<\/code>\u51fd\u6570\u7ed8\u5236\u67f1\u72b6\u56fe\u3002<code>palette<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u989c\u8272\u8c03\u8272\u677f\uff0c\u4ee5\u586b\u5145\u67f1\u72b6\u56fe\u7684\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h4>\u586b\u5145\u6563\u70b9\u56fe\u989c\u8272<\/h4>\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>\u751f\u6210\u793a\u4f8b\u6570\u636e<\/strong><\/h2>\n<p>data = sns.load_dataset(&#39;iris&#39;)<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe\u5e76\u586b\u5145\u989c\u8272<\/strong><\/h2>\n<p>sns.scatterplot(x=&#39;sepal_length&#39;, y=&#39;sepal_width&#39;, hue=&#39;species&#39;, data=data, palette=&#39;Set1&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528Seaborn\u5e93\u52a0\u8f7d\u793a\u4f8b\u6570\u636e\uff0c\u5e76\u4f7f\u7528<code>scatterplot<\/code>\u51fd\u6570\u7ed8\u5236\u6563\u70b9\u56fe\u3002<code>hue<\/code>\u53c2\u6570\u7528\u4e8e\u6839\u636e\u7c7b\u522b\u586b\u5145\u4e0d\u540c\u7684\u989c\u8272\uff0c<code>palette<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u989c\u8272\u8c03\u8272\u677f\u3002<\/p>\n<\/p>\n<p><h3>2\u3001\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04<\/h3>\n<\/p>\n<p><p>Seaborn\u5e93\u5141\u8bb8\u7528\u6237\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04\uff0c\u4ee5\u6ee1\u8db3\u7279\u5b9a\u7684\u53ef\u89c6\u5316\u9700\u6c42\u3002<\/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>\u751f\u6210\u793a\u4f8b\u6570\u636e<\/strong><\/h2>\n<p>data = sns.load_dataset(&#39;flights&#39;)<\/p>\n<h2><strong>\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04<\/strong><\/h2>\n<p>cmap = sns.cubehelix_palette(light=1, as_cmap=True)<\/p>\n<h2><strong>\u7ed8\u5236\u70ed\u529b\u56fe\u5e76\u586b\u5145\u989c\u8272<\/strong><\/h2>\n<p>sns.heatmap(data.pivot(&#39;month&#39;, &#39;year&#39;, &#39;passengers&#39;), cmap=cmap)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528Seaborn\u5e93\u52a0\u8f7d\u793a\u4f8b\u6570\u636e\uff0c\u5e76\u4f7f\u7528<code>cubehelix_palette<\/code>\u51fd\u6570\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04\u3002\u7136\u540e\u5728<code>heatmap<\/code>\u51fd\u6570\u4e2d\u4f7f\u7528\u8fd9\u4e2a\u81ea\u5b9a\u4e49\u7684\u989c\u8272\u6620\u5c04\u6765\u586b\u5145\u70ed\u529b\u56fe\u7684\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h2>\u4e94\u3001PLOTLY\u5e93\u7684\u586b\u5145\u8272\u65b9\u6cd5<\/h2>\n<\/p>\n<p><h3>1\u3001\u57fa\u672c\u586b\u5145\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>Plotly\u5e93\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u7ed8\u56fe\u5e93\uff0c\u63d0\u4f9b\u4e86\u591a\u79cd\u586b\u5145\u56fe\u5f62\u989c\u8272\u7684\u65b9\u6cd5\uff0c\u9002\u7528\u4e8e\u521b\u5efa\u4ea4\u4e92\u5f0f\u56fe\u8868\u548c\u4eea\u8868\u76d8\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u586b\u5145\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>\u586b\u5145\u9762\u79ef\u56fe\u989c\u8272<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import plotly.graph_objects as go<\/p>\n<h2><strong>\u751f\u6210\u793a\u4f8b\u6570\u636e<\/strong><\/h2>\n<p>x = [1, 2, 3, 4, 5]<\/p>\n<p>y = [10, 12, 15, 13, 17]<\/p>\n<h2><strong>\u7ed8\u5236\u9762\u79ef\u56fe\u5e76\u586b\u5145\u989c\u8272<\/strong><\/h2>\n<p>fig = go.Figure(go.Scatter(x=x, y=y, fill=&#39;tozeroy&#39;, fillcolor=&#39;lightblue&#39;))<\/p>\n<p>fig.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528Plotly\u5e93\u751f\u6210\u793a\u4f8b\u6570\u636e\uff0c\u5e76\u4f7f\u7528<code>go.Scatter<\/code>\u7c7b\u7ed8\u5236\u9762\u79ef\u56fe\u3002<code>fill<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u586b\u5145\u65b9\u5411\uff0c<code>fillcolor<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u586b\u5145\u7684\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h4>\u586b\u5145\u70ed\u529b\u56fe\u989c\u8272<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import plotly.graph_objects as go<\/p>\n<h2><strong>\u751f\u6210\u793a\u4f8b\u6570\u636e<\/strong><\/h2>\n<p>z = [[1, 20, 30], [20, 1, 60], [30, 60, 1]]<\/p>\n<h2><strong>\u7ed8\u5236\u70ed\u529b\u56fe\u5e76\u586b\u5145\u989c\u8272<\/strong><\/h2>\n<p>fig = go.Figure(data=go.Heatmap(z=z, colorscale=&#39;Viridis&#39;))<\/p>\n<p>fig.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528Plotly\u5e93\u751f\u6210\u793a\u4f8b\u6570\u636e\uff0c\u5e76\u4f7f\u7528<code>go.Heatmap<\/code>\u7c7b\u7ed8\u5236\u70ed\u529b\u56fe\u3002<code>colorscale<\/code>\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u989c\u8272\u8c03\u8272\u677f\uff0c\u4ee5\u586b\u5145\u70ed\u529b\u56fe\u7684\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h3>2\u3001\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04<\/h3>\n<\/p>\n<p><p>Plotly\u5e93\u5141\u8bb8\u7528\u6237\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04\uff0c\u4ee5\u6ee1\u8db3\u7279\u5b9a\u7684\u53ef\u89c6\u5316\u9700\u6c42\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import plotly.graph_objects as go<\/p>\n<h2><strong>\u751f\u6210\u793a\u4f8b\u6570\u636e<\/strong><\/h2>\n<p>z = [[1, 20, 30], [20, 1, 60], [30, 60, 1]]<\/p>\n<h2><strong>\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04<\/strong><\/h2>\n<p>colorscale = [[0, &#39;blue&#39;], [0.5, &#39;green&#39;], [1, &#39;red&#39;]]<\/p>\n<h2><strong>\u7ed8\u5236\u70ed\u529b\u56fe\u5e76\u586b\u5145\u989c\u8272<\/strong><\/h2>\n<p>fig = go.Figure(data=go.Heatmap(z=z, colorscale=colorscale))<\/p>\n<p>fig.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528Plotly\u5e93\u751f\u6210\u793a\u4f8b\u6570\u636e\uff0c\u5e76\u81ea\u5b9a\u4e49\u989c\u8272\u6620\u5c04\u3002\u4ece\u84dd\u8272\u5230\u7eff\u8272\u518d\u5230\u7ea2\u8272\u3002\u7136\u540e\u5728<code>go.Heatmap<\/code>\u7c7b\u4e2d\u4f7f\u7528\u8fd9\u4e2a\u81ea\u5b9a\u4e49\u7684\u989c\u8272\u6620\u5c04\u6765\u586b\u5145\u70ed\u529b\u56fe\u7684\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h2>\u516d\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u586b\u5145\u989c\u8272\u7684\u65b9\u6cd5\u591a\u79cd\u591a\u6837\uff0c\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u5e94\u7528\u573a\u666f\u548c\u9700\u6c42\u3002<strong>Matplotlib\u5e93\u9002\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\u548c\u56fe\u5f62\u7ed8\u5236\uff0c\u63d0\u4f9b\u4e86\u591a\u79cd\u586b\u5145\u56fe\u5f62\u989c\u8272\u7684\u65b9\u6cd5\uff0c\u5982<code>fill_between<\/code>\u3001<code>fill<\/code>\u548c<code>contourf<\/code>\u3002<\/strong> Pillow\u5e93\u9002\u7528\u4e8e\u56fe\u50cf\u5904\u7406\uff0c\u63d0\u4f9b\u4e86\u586b\u5145\u56fe\u50cf\u989c\u8272\u7684\u65b9\u6cd5\uff0c\u5982\u4f7f\u7528<code>ImageDraw<\/code>\u6a21\u5757\u548c<code>Image<\/code>\u6a21\u5757\u586b\u5145\u989c\u8272\u3002<strong>Tkinter\u5e93\u9002\u7528\u4e8eGUI\u5f00\u53d1\uff0c\u63d0\u4f9b\u4e86\u586b\u5145GUI\u7ec4\u4ef6\u989c\u8272\u7684\u65b9\u6cd5\uff0c\u5982\u586b\u5145\u7a97\u53e3\u80cc\u666f\u989c\u8272\u548c\u7ec4\u4ef6\u80cc\u666f\u989c\u8272\u3002<\/strong> Seaborn\u5e93\u57fa\u4e8eMatplotlib\uff0c\u9002\u7528\u4e8e\u9ad8\u7ea7\u6570\u636e\u53ef\u89c6\u5316\uff0c\u63d0\u4f9b\u4e86\u586b\u5145\u56fe\u8868\u989c\u8272\u7684\u65b9\u6cd5\uff0c\u5982\u586b\u5145\u67f1\u72b6\u56fe\u548c\u6563\u70b9\u56fe\u989c\u8272\u3002<strong>Plotly\u5e93\u9002\u7528\u4e8e\u521b\u5efa\u4ea4\u4e92\u5f0f\u56fe\u8868\u548c\u4eea\u8868\u76d8\uff0c\u63d0\u4f9b\u4e86\u586b\u5145\u56fe\u5f62\u989c\u8272\u7684\u65b9\u6cd5\uff0c\u5982\u586b\u5145\u9762\u79ef\u56fe\u548c\u70ed\u529b\u56fe\u989c\u8272\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u638c\u63e1\u8fd9\u4e9b\u5e93\u7684\u586b\u5145\u989c\u8272\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u5404\u79cd\u56fe\u5f62\u548c\u56fe\u50cf\u7684\u989c\u8272\u586b\u5145\uff0c\u63d0\u5347\u6570\u636e\u53ef\u89c6\u5316\u548c\u56fe\u50cf\u5904\u7406\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528\u989c\u8272\u586b\u5145\u56fe\u5f62\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5e93\u6765\u586b\u5145\u56fe\u5f62\u7684\u989c\u8272\uff0c\u4f8b\u5982Matplotlib\u3001Pygame\u548cTkinter\u7b49\u3002\u4ee5Matplotlib\u4e3a\u4f8b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>fill()<\/code>\u6216<code>fill_between()<\/code>\u51fd\u6570\u6765\u586b\u5145\u56fe\u5f62\u533a\u57df\uff0c\u6307\u5b9a\u989c\u8272\u53c2\u6570\u6765\u5b9e\u73b0\u6240\u9700\u7684\u989c\u8272\u6548\u679c\u3002Pygame\u4e2d\u53ef\u4ee5\u4f7f\u7528<code>pygame.draw.rect()<\/code>\u7b49\u51fd\u6570\uff0c\u540c\u65f6\u8bbe\u7f6e\u989c\u8272\u53c2\u6570\u6765\u586b\u5145\u77e9\u5f62\u6216\u5176\u4ed6\u5f62\u72b6\u3002<\/p>\n<p><strong>\u5728Python\u7684\u56fe\u5f62\u754c\u9762\u4e2d\u5982\u4f55\u5b9e\u73b0\u80cc\u666f\u8272\u7684\u586b\u5145\uff1f<\/strong><br \/>\u5728\u4f7f\u7528Tkinter\u6784\u5efa\u56fe\u5f62\u7528\u6237\u754c\u9762\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u7a97\u53e3\u7684<code>bg<\/code>\u5c5e\u6027\u6765\u6539\u53d8\u80cc\u666f\u989c\u8272\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>root.configure(bg=&#39;color&#39;)<\/code>\u53ef\u4ee5\u5c06\u7a97\u53e3\u7684\u80cc\u666f\u586b\u5145\u4e3a\u6307\u5b9a\u989c\u8272\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u5728Canvas\u7ec4\u4ef6\u4e2d\u4f7f\u7528<code>create_rectangle()<\/code>\u7b49\u65b9\u6cd5\u8bbe\u7f6e\u586b\u5145\u989c\u8272\uff0c\u4ee5\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u56fe\u5f62\u6548\u679c\u3002<\/p>\n<p><strong>\u6709\u6ca1\u6709\u53ef\u4ee5\u81ea\u52a8\u9009\u62e9\u989c\u8272\u7684Python\u5e93\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u6709\u4e00\u4e9bPython\u5e93\u53ef\u4ee5\u5e2e\u52a9\u81ea\u52a8\u9009\u62e9\u989c\u8272\u3002\u4f8b\u5982\uff0c<code>colormath<\/code>\u5e93\u53ef\u4ee5\u6839\u636e\u8272\u8f6e\u751f\u6210\u548c\u8f6c\u6362\u989c\u8272\u3002<code>seaborn<\/code>\u5e93\u5219\u63d0\u4f9b\u4e86\u591a\u79cd\u8c03\u8272\u677f\uff0c\u53ef\u4ee5\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\u65f6\u7684\u989c\u8272\u586b\u5145\uff0c\u5e2e\u52a9\u7528\u6237\u8f7b\u677e\u9009\u62e9\u548c\u5e94\u7528\u989c\u8272\u7ec4\u5408\uff0c\u63d0\u5347\u53ef\u89c6\u5316\u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u8bed\u8a00\u586b\u5145\u8272\u7684\u4e3b\u8981\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528matplotlib\u5e93\u586b\u5145\u56fe\u5f62\u989c\u8272\u3001\u4f7f\u7528Pillow\u5e93\u586b\u5145\u56fe\u50cf\u989c\u8272\u3001\u4f7f [&hellip;]","protected":false},"author":3,"featured_media":1169127,"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\/1169122"}],"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=1169122"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1169122\/revisions"}],"predecessor-version":[{"id":1169129,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1169122\/revisions\/1169129"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1169127"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1169122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1169122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1169122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}