{"id":974890,"date":"2024-12-27T06:08:49","date_gmt":"2024-12-26T22:08:49","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/974890.html"},"modified":"2024-12-27T06:08:52","modified_gmt":"2024-12-26T22:08:52","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e7%bb%98%e5%88%b6%e8%8f%b1%e5%bd%a2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/974890.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u7ed8\u5236\u83f1\u5f62"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24200401\/acb033f9-9a22-4d7c-91d0-28c4d171c019.webp\" alt=\"python\u4e2d\u5982\u4f55\u7ed8\u5236\u83f1\u5f62\" \/><\/p>\n<p><p> \u5728Python\u4e2d\u7ed8\u5236\u83f1\u5f62\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u4f60\u6240\u4f7f\u7528\u7684\u5e93\u548c\u5de5\u5177\u3002<strong>\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528Matplotlib\u3001Turtle\u6216PIL\u5e93\u6765\u7ed8\u5236\u83f1\u5f62\u56fe\u5f62<\/strong>\u3002\u8fd9\u4e9b\u5de5\u5177\u5404\u6709\u5176\u7279\u70b9\u548c\u9002\u7528\u573a\u666f\uff0c\u4f8b\u5982\uff0cMatplotlib\u9002\u5408\u4e8e\u6570\u636e\u53ef\u89c6\u5316\uff0cTurtle\u9002\u5408\u4e8e\u7b80\u5355\u7684\u56fe\u5f62\u7ed8\u5236\uff0c\u800cPIL\u5219\u9002\u5408\u4e8e\u56fe\u50cf\u5904\u7406\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u51e0\u79cd\u5de5\u5177\u5728Python\u4e2d\u7ed8\u5236\u83f1\u5f62\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528MATPLOTLIB\u7ed8\u5236\u83f1\u5f62<\/h3>\n<\/p>\n<p><p>Matplotlib\u662fPython\u4e2d\u4e00\u4e2a\u5f3a\u5927\u7684\u7ed8\u56fe\u5e93\uff0c\u7279\u522b\u9002\u7528\u4e8e\u521b\u5efa\u9759\u6001\u3001\u52a8\u6001\u548c\u4ea4\u4e92\u5f0f\u7684\u56fe\u8868\u548c\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><h4>1.1 \u4f7f\u7528<code>plot<\/code>\u65b9\u6cd5\u7ed8\u5236<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Matplotlib\u7684<code>plot<\/code>\u65b9\u6cd5\u7ed8\u5236\u4e00\u4e2a\u7b80\u5355\u7684\u83f1\u5f62\u3002\u9700\u8981\u5b9a\u4e49\u83f1\u5f62\u7684\u56db\u4e2a\u9876\u70b9\u7684\u5750\u6807\uff0c\u7136\u540e\u8fde\u63a5\u8fd9\u4e9b\u70b9\u5373\u53ef\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>def draw_diamond():<\/p>\n<p>    # \u5b9a\u4e49\u83f1\u5f62\u7684\u9876\u70b9<\/p>\n<p>    x = [0, 1, 0, -1, 0]<\/p>\n<p>    y = [1, 0, -1, 0, 1]<\/p>\n<p>    # \u7ed8\u5236\u83f1\u5f62<\/p>\n<p>    plt.plot(x, y, &#39;b-&#39;)<\/p>\n<p>    plt.fill(x, y, &#39;cyan&#39;, alpha=0.3)  # \u586b\u5145\u989c\u8272<\/p>\n<p>    plt.title(&#39;Diamond Shape&#39;)<\/p>\n<p>    plt.axis(&#39;equal&#39;)<\/p>\n<p>    plt.grid(True)<\/p>\n<p>    plt.show()<\/p>\n<p>draw_diamond()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<strong>\u6211\u4eec\u5b9a\u4e49\u4e86\u83f1\u5f62\u7684\u56db\u4e2a\u9876\u70b9\u5750\u6807<\/strong>\uff1a\u4e0a\u3001\u53f3\u3001\u4e0b\u3001\u5de6\u3002\u7136\u540e\u4f7f\u7528<code>plot<\/code>\u51fd\u6570\u5c06\u8fd9\u4e9b\u70b9\u8fde\u63a5\u8d77\u6765\uff0c\u6700\u540e\u7528<code>fill<\/code>\u51fd\u6570\u4e3a\u83f1\u5f62\u586b\u5145\u989c\u8272\u3002<\/p>\n<\/p>\n<p><h4>1.2 \u4f7f\u7528<code>Polygon<\/code>\u5bf9\u8c61\u7ed8\u5236<\/h4>\n<\/p>\n<p><p>\u6b64\u5916\uff0cMatplotlib\u8fd8\u63d0\u4f9b\u4e86<code>Polygon<\/code>\u5bf9\u8c61\uff0c\u53ef\u4ee5\u7528\u6765\u7ed8\u5236\u591a\u8fb9\u5f62\uff0c\u5305\u62ec\u83f1\u5f62\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>from matplotlib.patches import Polygon<\/p>\n<p>def draw_diamond_polygon():<\/p>\n<p>    # \u5b9a\u4e49\u83f1\u5f62\u7684\u9876\u70b9<\/p>\n<p>    vertices = [(0, 1), (1, 0), (0, -1), (-1, 0)]<\/p>\n<p>    diamond = Polygon(vertices, closed=True, fill=True, color=&#39;cyan&#39;, alpha=0.3)<\/p>\n<p>    fig, ax = plt.subplots()<\/p>\n<p>    ax.add_patch(diamond)<\/p>\n<p>    ax.set_xlim(-2, 2)<\/p>\n<p>    ax.set_ylim(-2, 2)<\/p>\n<p>    ax.set_aspect(&#39;equal&#39;)<\/p>\n<p>    plt.title(&#39;Diamond Shape using Polygon&#39;)<\/p>\n<p>    plt.grid(True)<\/p>\n<p>    plt.show()<\/p>\n<p>draw_diamond_polygon()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<strong>\u6211\u4eec\u4f7f\u7528<code>Polygon<\/code>\u5bf9\u8c61\u6765\u521b\u5efa\u83f1\u5f62<\/strong>\uff0c\u7136\u540e\u5c06\u5176\u6dfb\u52a0\u5230\u56fe\u8868\u4e2d\u3002\u8fd9\u6837\u7684\u65b9\u6cd5\u66f4\u4e3a\u7075\u6d3b\uff0c\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u8fdb\u884c\u590d\u6742\u7684\u5f62\u72b6\u7ed8\u5236\u548c\u6837\u5f0f\u8bbe\u7f6e\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528TURTLE\u7ed8\u5236\u83f1\u5f62<\/h3>\n<\/p>\n<p><p>Turtle\u662fPython\u5185\u7f6e\u7684\u4e00\u4e2a\u7b80\u5355\u7684\u7ed8\u56fe\u5e93\uff0c\u9002\u5408\u4e8e\u521d\u5b66\u8005\u5b66\u4e60\u7f16\u7a0b\u548c\u7ed8\u56fe\u3002<\/p>\n<\/p>\n<p><h4>2.1 \u57fa\u7840\u83f1\u5f62\u7ed8\u5236<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import turtle<\/p>\n<p>def draw_diamond_turtle():<\/p>\n<p>    screen = turtle.Screen()<\/p>\n<p>    screen.title(&#39;Diamond Shape using Turtle&#39;)<\/p>\n<p>    diamond = turtle.Turtle()<\/p>\n<p>    diamond.penup()<\/p>\n<p>    diamond.goto(0, -100)<\/p>\n<p>    diamond.pendown()<\/p>\n<p>    for _ in range(2):<\/p>\n<p>        diamond.forward(100)<\/p>\n<p>        diamond.left(135)<\/p>\n<p>        diamond.forward(100)<\/p>\n<p>        diamond.left(45)<\/p>\n<p>    turtle.done()<\/p>\n<p>draw_diamond_turtle()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7Turtle\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7<strong>\u63a7\u5236\u6d77\u9f9f\u7684\u8fd0\u52a8<\/strong>\u6765\u7ed8\u5236\u83f1\u5f62\u3002\u8fd9\u91cc\u6211\u4eec\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6d77\u9f9f\uff0c\u7136\u540e\u4f7f\u7528\u5faa\u73af\u6765\u7ed8\u5236\u83f1\u5f62\u7684\u8fb9\u3002<\/p>\n<\/p>\n<p><h4>2.2 \u6dfb\u52a0\u66f4\u591a\u7ec6\u8282<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u8fd8\u53ef\u4ee5\u6dfb\u52a0\u66f4\u591a\u7ec6\u8282\uff0c\u6bd4\u5982\u8bbe\u7f6e\u989c\u8272\u548c\u7ebf\u6761\u7c97\u7ec6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import turtle<\/p>\n<p>def draw_diamond_turtle_det<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>led():<\/p>\n<p>    screen = turtle.Screen()<\/p>\n<p>    screen.title(&#39;Detailed Diamond Shape using Turtle&#39;)<\/p>\n<p>    diamond = turtle.Turtle()<\/p>\n<p>    diamond.color(&#39;blue&#39;)<\/p>\n<p>    diamond.pensize(3)<\/p>\n<p>    diamond.penup()<\/p>\n<p>    diamond.goto(0, -100)<\/p>\n<p>    diamond.pendown()<\/p>\n<p>    for _ in range(2):<\/p>\n<p>        diamond.forward(100)<\/p>\n<p>        diamond.left(135)<\/p>\n<p>        diamond.forward(100)<\/p>\n<p>        diamond.left(45)<\/p>\n<p>    diamond.hideturtle()<\/p>\n<p>    turtle.done()<\/p>\n<p>draw_diamond_turtle_detailed()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<strong>\u6211\u4eec\u8bbe\u7f6e\u4e86\u6d77\u9f9f\u7684\u989c\u8272\u548c\u7ebf\u6761\u7c97\u7ec6<\/strong>\uff0c\u5e76\u5728\u7ed8\u5236\u5b8c\u6210\u540e\u9690\u85cf\u6d77\u9f9f\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528PIL\u7ed8\u5236\u83f1\u5f62<\/h3>\n<\/p>\n<p><p>PIL(Python Imaging Library)\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u53ef\u4ee5\u7528\u6765\u521b\u5efa\u548c\u4fee\u6539\u56fe\u50cf\u3002<\/p>\n<\/p>\n<p><h4>3.1 \u521b\u5efa\u83f1\u5f62\u56fe\u50cf<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528PIL\u6765\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u83f1\u5f62\u7684\u56fe\u50cf\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image, ImageDraw<\/p>\n<p>def create_diamond_image():<\/p>\n<p>    # \u521b\u5efa\u4e00\u4e2a\u767d\u8272\u80cc\u666f\u7684\u56fe\u50cf<\/p>\n<p>    image = Image.new(&#39;RGB&#39;, (200, 200), &#39;white&#39;)<\/p>\n<p>    draw = ImageDraw.Draw(image)<\/p>\n<p>    # \u5b9a\u4e49\u83f1\u5f62\u7684\u9876\u70b9<\/p>\n<p>    vertices = [(100, 20), (180, 100), (100, 180), (20, 100)]<\/p>\n<p>    # \u7ed8\u5236\u83f1\u5f62<\/p>\n<p>    draw.polygon(vertices, outline=&#39;blue&#39;, fill=&#39;cyan&#39;)<\/p>\n<p>    # \u4fdd\u5b58\u56fe\u50cf<\/p>\n<p>    image.save(&#39;diamond.png&#39;)<\/p>\n<p>    image.show()<\/p>\n<p>create_diamond_image()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6b64\u4f8b\u4e2d\uff0c<strong>\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684\u56fe\u50cf<\/strong>\uff0c\u7136\u540e\u4f7f\u7528<code>ImageDraw<\/code>\u5bf9\u8c61\u6765\u7ed8\u5236\u83f1\u5f62\uff0c\u6700\u540e\u4fdd\u5b58\u5e76\u663e\u793a\u8be5\u56fe\u50cf\u3002<\/p>\n<\/p>\n<p><h4>3.2 \u66f4\u590d\u6742\u7684\u56fe\u50cf\u5904\u7406<\/h4>\n<\/p>\n<p><p>PIL\u8fd8\u652f\u6301\u66f4\u590d\u6742\u7684\u56fe\u50cf\u5904\u7406\u64cd\u4f5c\uff0c\u4f8b\u5982\u6dfb\u52a0\u6587\u672c\u6216\u4f7f\u7528\u4e0d\u540c\u7684\u586b\u5145\u6a21\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image, ImageDraw, ImageFont<\/p>\n<p>def create_diamond_image_with_text():<\/p>\n<p>    # \u521b\u5efa\u4e00\u4e2a\u767d\u8272\u80cc\u666f\u7684\u56fe\u50cf<\/p>\n<p>    image = Image.new(&#39;RGB&#39;, (200, 200), &#39;white&#39;)<\/p>\n<p>    draw = ImageDraw.Draw(image)<\/p>\n<p>    # \u5b9a\u4e49\u83f1\u5f62\u7684\u9876\u70b9<\/p>\n<p>    vertices = [(100, 20), (180, 100), (100, 180), (20, 100)]<\/p>\n<p>    # \u7ed8\u5236\u83f1\u5f62<\/p>\n<p>    draw.polygon(vertices, outline=&#39;blue&#39;, fill=&#39;cyan&#39;)<\/p>\n<p>    # \u6dfb\u52a0\u6587\u672c<\/p>\n<p>    font = ImageFont.load_default()<\/p>\n<p>    draw.text((50, 150), &quot;Diamond&quot;, font=font, fill=&quot;black&quot;)<\/p>\n<p>    # \u4fdd\u5b58\u56fe\u50cf<\/p>\n<p>    image.save(&#39;diamond_with_text.png&#39;)<\/p>\n<p>    image.show()<\/p>\n<p>create_diamond_image_with_text()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528<code>ImageFont<\/code>\u5bf9\u8c61\u5728\u56fe\u50cf\u4e0a\u6dfb\u52a0\u6587\u672c\uff0c<strong>\u8fd9\u5c55\u793a\u4e86PIL\u5728\u56fe\u50cf\u5904\u7406\u65b9\u9762\u7684\u5f3a\u5927\u529f\u80fd<\/strong>\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u7ed8\u5236\u83f1\u5f62\u5728Python\u4e2d\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c<strong>\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u52bf\u548c\u9002\u7528\u573a\u666f<\/strong>\u3002Matplotlib\u9002\u5408\u9700\u8981\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u7684\u573a\u5408\uff0c\u800cTurtle\u5219\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u6559\u5b66\u5de5\u5177\uff0cPIL\u5219\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\u3002\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u5c06\u5e2e\u52a9\u4f60\u66f4\u6709\u6548\u5730\u5b9e\u73b0\u4f60\u7684\u76ee\u6807\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u56fe\u5f62\u7ed8\u5236\u8fd8\u662f\u590d\u6742\u7684\u56fe\u50cf\u5904\u7406\uff0c\u8fd9\u4e9b\u5de5\u5177\u90fd\u80fd\u4e3a\u4f60\u63d0\u4f9b\u4e30\u5bcc\u7684\u529f\u80fd\u548c\u4fbf\u5229\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u7ed8\u5236\u83f1\u5f62\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5e93\u6765\u7ed8\u5236\u83f1\u5f62\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5e93\u662fMatplotlib\u3002\u9996\u5148\uff0c\u4f60\u9700\u8981\u5b89\u88c5Matplotlib\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4<code>pip install matplotlib<\/code>\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u7ed8\u5236\u83f1\u5f62\uff1a<\/p>\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\n\n# \u5b9a\u4e49\u83f1\u5f62\u7684\u9876\u70b9\npoints = [(0, 1), (1, 0), (0, -1), (-1, 0)]\n\n# \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u56fe\u5f62\nplt.figure()\n\n# \u586b\u5145\u83f1\u5f62\nplt.fill(*zip(*points), color=&#39;lightblue&#39;)\n\n# \u8bbe\u7f6e\u5750\u6807\u8f74\u8303\u56f4\nplt.xlim(-2, 2)\nplt.ylim(-2, 2)\n\n# \u6dfb\u52a0\u7f51\u683c\nplt.grid()\n\n# \u663e\u793a\u56fe\u5f62\nplt.show()\n<\/code><\/pre>\n<p><strong>\u7ed8\u5236\u83f1\u5f62\u65f6\uff0c\u5982\u4f55\u8c03\u6574\u5176\u5927\u5c0f\u548c\u4f4d\u7f6e\uff1f<\/strong><br \/>\u83f1\u5f62\u7684\u5927\u5c0f\u548c\u4f4d\u7f6e\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u9876\u70b9\u5750\u6807\u6765\u5b9e\u73b0\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u6539\u53d8\u6bcf\u4e2a\u9876\u70b9\u7684\u5750\u6807\u503c\u6765\u653e\u5927\u6216\u7f29\u5c0f\u83f1\u5f62\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5e0c\u671b\u83f1\u5f62\u53d8\u5927\uff0c\u53ef\u4ee5\u5c06\u9876\u70b9\u7684\u5750\u6807\u4e58\u4ee5\u4e00\u4e2a\u6bd4\u4f8b\u56e0\u5b50\uff0c\u59822\u62163\u3002\u6b64\u5916\uff0c\u82e5\u5e0c\u671b\u79fb\u52a8\u83f1\u5f62\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u6bcf\u4e2a\u5750\u6807\u4e0a\u6dfb\u52a0\u4e00\u4e2a\u504f\u79fb\u91cf\uff0c\u4f8b\u5982\u52a0\u4e0a(1, 1)\u6765\u5c06\u83f1\u5f62\u5411\u53f3\u4e0a\u65b9\u79fb\u52a8\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u83f1\u5f62\u4e0a\u6dfb\u52a0\u6587\u672c\u6216\u6807\u7b7e\uff1f<\/strong><br \/>\u5728\u4f7f\u7528Matplotlib\u7ed8\u5236\u83f1\u5f62\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7<code>plt.text()<\/code>\u51fd\u6570\u5728\u56fe\u5f62\u4e0a\u6dfb\u52a0\u6587\u672c\u6216\u6807\u7b7e\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60f3\u5728\u83f1\u5f62\u7684\u4e2d\u5fc3\u6dfb\u52a0\u4e00\u4e2a\u6807\u7b7e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-python\"># \u5728\u83f1\u5f62\u4e2d\u5fc3\u6dfb\u52a0\u6587\u672c\nplt.text(0, 0, &#39;\u83f1\u5f62&#39;, horizontalalignment=&#39;center&#39;, verticalalignment=&#39;center&#39;, fontsize=12, color=&#39;black&#39;)\n<\/code><\/pre>\n<p>\u901a\u8fc7\u8c03\u6574<code>horizontalalignment<\/code>\u548c<code>verticalalignment<\/code>\u53c2\u6570\uff0c\u53ef\u4ee5\u7cbe\u786e\u63a7\u5236\u6587\u672c\u7684\u4f4d\u7f6e\u548c\u5bf9\u9f50\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u7ed8\u5236\u83f1\u5f62\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u4f60\u6240\u4f7f\u7528\u7684\u5e93\u548c\u5de5\u5177\u3002\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528Matplotli [&hellip;]","protected":false},"author":3,"featured_media":974896,"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\/974890"}],"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=974890"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/974890\/revisions"}],"predecessor-version":[{"id":974899,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/974890\/revisions\/974899"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/974896"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=974890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=974890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=974890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}