{"id":1124426,"date":"2025-01-08T19:41:27","date_gmt":"2025-01-08T11:41:27","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1124426.html"},"modified":"2025-01-08T19:41:29","modified_gmt":"2025-01-08T11:41:29","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e7%bb%98%e5%88%b6%e5%ae%9e%e5%bf%83%e4%ba%94%e8%a7%92%e6%98%9f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1124426.html","title":{"rendered":"\u5982\u4f55\u7528python\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25085507\/4e25b6cd-aade-41ca-a8bd-0d73eda48461.webp\" alt=\"\u5982\u4f55\u7528python\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\" \/><\/p>\n<p><p> <strong>\u5982\u4f55\u7528Python\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f<\/strong><\/p>\n<\/p>\n<p><p><strong>\u7528Python\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Turtle\u6a21\u5757\u3001\u5229\u7528Matplotlib\u5e93\u3001\u4f7f\u7528Pygame\u5e93\u3002<\/strong> \u5176\u4e2d\u6700\u7b80\u5355\u4e14\u76f4\u89c2\u7684\u65b9\u6cd5\u662f\u4f7f\u7528Turtle\u6a21\u5757\u3002\u901a\u8fc7Turtle\u6a21\u5757\uff0c\u6211\u4eec\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u7ed8\u5236\u5404\u79cd\u5f62\u72b6\uff0c\u5305\u62ec\u5b9e\u5fc3\u4e94\u89d2\u661f\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Turtle\u6a21\u5757\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528Turtle\u6a21\u5757\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f<\/h3>\n<\/p>\n<p><p>Python\u7684Turtle\u6a21\u5757\u662f\u4e00\u79cd\u57fa\u4e8eTkinter\u7684\u56fe\u5f62\u5e93\uff0c\u7279\u522b\u9002\u5408\u521d\u5b66\u8005\u7528\u4e8e\u7ed8\u5236\u56fe\u5f62\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Turtle\u6a21\u5757\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5Turtle\u6a21\u5757<\/h4>\n<\/p>\n<p><p>Turtle\u6a21\u5757\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u989d\u5916\u5b89\u88c5\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u5bfc\u5165Turtle\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import turtle<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8bbe\u7f6eTurtle\u753b\u7b14<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u8bbe\u7f6eTurtle\u753b\u7b14\u7684\u5c5e\u6027\uff0c\u5982\u753b\u7b14\u989c\u8272\u3001\u586b\u5145\u989c\u8272\u548c\u753b\u7b14\u7c97\u7ec6\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">turtle.color(&quot;black&quot;, &quot;yellow&quot;)  # \u8bbe\u7f6e\u753b\u7b14\u989c\u8272\u548c\u586b\u5145\u989c\u8272<\/p>\n<p>turtle.pensize(2)  # \u8bbe\u7f6e\u753b\u7b14\u7c97\u7ec6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u7ed8\u5236\u4e94\u89d2\u661f\u7684\u8f6e\u5ed3<\/h4>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u7ed8\u5236\u4e94\u89d2\u661f\u7684\u8f6e\u5ed3\u3002\u4e94\u89d2\u661f\u6709\u4e94\u4e2a\u9876\u70b9\uff0c\u6bcf\u4e2a\u9876\u70b9\u4e4b\u95f4\u7684\u89d2\u5ea6\u4e3a144\u5ea6\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5faa\u73af\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">turtle.begin_fill()  # \u5f00\u59cb\u586b\u5145\u989c\u8272<\/p>\n<p>for _ in range(5):<\/p>\n<p>    turtle.forward(200)  # \u5411\u524d\u79fb\u52a8200\u4e2a\u5355\u4f4d\u957f\u5ea6<\/p>\n<p>    turtle.right(144)  # \u53f3\u8f6c144\u5ea6<\/p>\n<p>turtle.end_fill()  # \u7ed3\u675f\u586b\u5145\u989c\u8272<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u5b8c\u6574\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u5c06\u4e0a\u8ff0\u6b65\u9aa4\u6574\u5408\u8d77\u6765\uff0c\u6700\u7ec8\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import turtle<\/p>\n<p>turtle.color(&quot;black&quot;, &quot;yellow&quot;)  # \u8bbe\u7f6e\u753b\u7b14\u989c\u8272\u548c\u586b\u5145\u989c\u8272<\/p>\n<p>turtle.pensize(2)  # \u8bbe\u7f6e\u753b\u7b14\u7c97\u7ec6<\/p>\n<p>turtle.begin_fill()  # \u5f00\u59cb\u586b\u5145\u989c\u8272<\/p>\n<p>for _ in range(5):<\/p>\n<p>    turtle.forward(200)  # \u5411\u524d\u79fb\u52a8200\u4e2a\u5355\u4f4d\u957f\u5ea6<\/p>\n<p>    turtle.right(144)  # \u53f3\u8f6c144\u5ea6<\/p>\n<p>turtle.end_fill()  # \u7ed3\u675f\u586b\u5145\u989c\u8272<\/p>\n<p>turtle.done()  # \u7ed3\u675f\u7ed8\u56fe<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u5229\u7528Matplotlib\u5e93\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f<\/h3>\n<\/p>\n<p><p>Matplotlib\u662fPython\u4e2d\u6700\u6d41\u884c\u7684\u7ed8\u56fe\u5e93\u4e4b\u4e00\uff0c\u9002\u7528\u4e8e\u751f\u6210\u5404\u79cd\u56fe\u8868\u548c\u56fe\u5f62\u3002\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528Matplotlib\u6765\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5Matplotlib\u5e93<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5b89\u88c5Matplotlib\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\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><h4>2. \u5bfc\u5165\u5fc5\u8981\u7684\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u7ed8\u5236\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5bfc\u5165Matplotlib\u7684pyplot\u6a21\u5757\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><\/code><\/pre>\n<\/p>\n<p><h4>3. \u8ba1\u7b97\u4e94\u89d2\u661f\u7684\u9876\u70b9\u5750\u6807<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u4e94\u89d2\u661f\u7684\u4e94\u4e2a\u9876\u70b9\u7684\u5750\u6807\uff0c\u7136\u540e\u5229\u7528\u8fd9\u4e9b\u5750\u6807\u7ed8\u5236\u4e94\u89d2\u661f\u3002\u53ef\u4ee5\u4f7f\u7528numpy\u5e93\u6765\u8fdb\u884c\u5750\u6807\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def get_star_points(center, radius):<\/p>\n<p>    points = []<\/p>\n<p>    for i in range(5):<\/p>\n<p>        angle = i * 144 * np.pi \/ 180<\/p>\n<p>        x = center[0] + radius * np.cos(angle)<\/p>\n<p>        y = center[1] + radius * np.sin(angle)<\/p>\n<p>        points.append([x, y])<\/p>\n<p>    return points<\/p>\n<p>center = [0, 0]<\/p>\n<p>radius = 1<\/p>\n<p>points = get_star_points(center, radius)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u7ed8\u5236\u4e94\u89d2\u661f\u5e76\u586b\u5145\u989c\u8272<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Matplotlib\u7684fill\u51fd\u6570\u6765\u7ed8\u5236\u4e94\u89d2\u661f\u5e76\u586b\u5145\u989c\u8272\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">points = np.array(points)<\/p>\n<p>plt.fill(points[:, 0], points[:, 1], &#39;yellow&#39;)<\/p>\n<p>plt.plot(points[:, 0], points[:, 1], &#39;black&#39;)<\/p>\n<p>plt.axis(&#39;equal&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>5. \u5b8c\u6574\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u5c06\u4e0a\u8ff0\u6b65\u9aa4\u6574\u5408\u8d77\u6765\uff0c\u6700\u7ec8\u7684\u4ee3\u7801\u5982\u4e0b\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>def get_star_points(center, radius):<\/p>\n<p>    points = []<\/p>\n<p>    for i in range(5):<\/p>\n<p>        angle = i * 144 * np.pi \/ 180<\/p>\n<p>        x = center[0] + radius * np.cos(angle)<\/p>\n<p>        y = center[1] + radius * np.sin(angle)<\/p>\n<p>        points.append([x, y])<\/p>\n<p>    return points<\/p>\n<p>center = [0, 0]<\/p>\n<p>radius = 1<\/p>\n<p>points = get_star_points(center, radius)<\/p>\n<p>points = np.array(points)<\/p>\n<p>plt.fill(points[:, 0], points[:, 1], &#39;yellow&#39;)<\/p>\n<p>plt.plot(points[:, 0], points[:, 1], &#39;black&#39;)<\/p>\n<p>plt.axis(&#39;equal&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528Pygame\u5e93\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f<\/h3>\n<\/p>\n<p><p>Pygame\u662f\u4e00\u4e2a\u8de8\u5e73\u53f0\u7684Python\u6a21\u5757\uff0c\u4e13\u95e8\u7528\u4e8e\u7f16\u5199\u89c6\u9891\u6e38\u620f\u3002\u5b83\u5305\u62ec\u5bf9\u56fe\u5f62\u3001\u58f0\u97f3\u548c\u8f93\u5165\u8bbe\u5907\u7684\u652f\u6301\u3002\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528Pygame\u6765\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5Pygame\u5e93<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5b89\u88c5Pygame\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pygame<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u5bfc\u5165\u5fc5\u8981\u7684\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u7ed8\u5236\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5bfc\u5165Pygame\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pygame<\/p>\n<p>import math<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u521d\u59cb\u5316Pygame<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u9700\u8981\u521d\u59cb\u5316Pygame\uff0c\u5e76\u8bbe\u7f6e\u7a97\u53e3\u7684\u5927\u5c0f\u548c\u80cc\u666f\u989c\u8272\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">pygame.init()<\/p>\n<p>screen = pygame.display.set_mode((600, 600))<\/p>\n<p>screen.fill((255, 255, 255))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u8ba1\u7b97\u4e94\u89d2\u661f\u7684\u9876\u70b9\u5750\u6807<\/h4>\n<\/p>\n<p><p>\u4e0eMatplotlib\u7c7b\u4f3c\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u4e94\u89d2\u661f\u7684\u4e94\u4e2a\u9876\u70b9\u7684\u5750\u6807\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def get_star_points(center, radius):<\/p>\n<p>    points = []<\/p>\n<p>    for i in range(5):<\/p>\n<p>        angle = i * 144 * math.pi \/ 180<\/p>\n<p>        x = center[0] + radius * math.cos(angle)<\/p>\n<p>        y = center[1] + radius * math.sin(angle)<\/p>\n<p>        points.append((x, y))<\/p>\n<p>    return points<\/p>\n<p>center = [300, 300]<\/p>\n<p>radius = 100<\/p>\n<p>points = get_star_points(center, radius)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>5. \u7ed8\u5236\u4e94\u89d2\u661f\u5e76\u586b\u5145\u989c\u8272<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Pygame\u7684draw.polygon\u51fd\u6570\u6765\u7ed8\u5236\u4e94\u89d2\u661f\u5e76\u586b\u5145\u989c\u8272\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">pygame.draw.polygon(screen, (255, 255, 0), points)<\/p>\n<p>pygame.draw.polygon(screen, (0, 0, 0), points, 1)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>6. \u663e\u793a\u7a97\u53e3<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u9700\u8981\u66f4\u65b0\u7a97\u53e3\u4ee5\u663e\u793a\u7ed8\u5236\u7684\u4e94\u89d2\u661f\uff0c\u5e76\u6dfb\u52a0\u4e00\u4e2a\u4e8b\u4ef6\u5faa\u73af\uff0c\u4ee5\u4fbf\u5173\u95ed\u7a97\u53e3\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">pygame.display.flip()<\/p>\n<p>running = True<\/p>\n<p>while running:<\/p>\n<p>    for event in pygame.event.get():<\/p>\n<p>        if event.type == pygame.QUIT:<\/p>\n<p>            running = False<\/p>\n<p>pygame.quit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>7. \u5b8c\u6574\u4ee3\u7801<\/h4>\n<\/p>\n<p><p>\u5c06\u4e0a\u8ff0\u6b65\u9aa4\u6574\u5408\u8d77\u6765\uff0c\u6700\u7ec8\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pygame<\/p>\n<p>import math<\/p>\n<p>def get_star_points(center, radius):<\/p>\n<p>    points = []<\/p>\n<p>    for i in range(5):<\/p>\n<p>        angle = i * 144 * math.pi \/ 180<\/p>\n<p>        x = center[0] + radius * math.cos(angle)<\/p>\n<p>        y = center[1] + radius * math.sin(angle)<\/p>\n<p>        points.append((x, y))<\/p>\n<p>    return points<\/p>\n<p>pygame.init()<\/p>\n<p>screen = pygame.display.set_mode((600, 600))<\/p>\n<p>screen.fill((255, 255, 255))<\/p>\n<p>center = [300, 300]<\/p>\n<p>radius = 100<\/p>\n<p>points = get_star_points(center, radius)<\/p>\n<p>pygame.draw.polygon(screen, (255, 255, 0), points)<\/p>\n<p>pygame.draw.polygon(screen, (0, 0, 0), points, 1)<\/p>\n<p>pygame.display.flip()<\/p>\n<p>running = True<\/p>\n<p>while running:<\/p>\n<p>    for event in pygame.event.get():<\/p>\n<p>        if event.type == pygame.QUIT:<\/p>\n<p>            running = False<\/p>\n<p>pygame.quit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\uff0c\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528\u4e09\u79cd\u4e0d\u540c\u7684\u65b9\u6cd5\u6765\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u3002<strong>Turtle\u6a21\u5757<\/strong>\u9002\u5408\u521d\u5b66\u8005\uff0c\u7b80\u5355\u6613\u7528\uff1b<strong>Matplotlib\u5e93<\/strong>\u9002\u5408\u751f\u6210\u5404\u79cd\u56fe\u8868\u548c\u56fe\u5f62\uff0c\u529f\u80fd\u5f3a\u5927\uff1b<strong>Pygame\u5e93<\/strong>\u9002\u5408\u7f16\u5199\u89c6\u9891\u6e38\u620f\uff0c\u63d0\u4f9b\u4e30\u5bcc\u7684\u56fe\u5f62\u548c\u58f0\u97f3\u652f\u6301\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff0c\u8ba9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u638c\u63e1Python\u7ed8\u56fe\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528\u56fe\u5f62\u5e93\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u56fe\u5f62\u5e93\u6765\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u3002\u6700\u5e38\u7528\u7684\u5e93\u662fMatplotlib\u548cTurtle\u3002\u4f7f\u7528Matplotlib\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9a\u4e49\u4e94\u89d2\u661f\u7684\u5750\u6807\u70b9\u5e76\u586b\u5145\u989c\u8272\u6765\u5b9e\u73b0\u3002Turtle\u5e93\u5219\u63d0\u4f9b\u4e86\u66f4\u4e3a\u76f4\u89c2\u7684\u7ed8\u56fe\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u547d\u4ee4\u6765\u63a7\u5236\u7ed8\u5236\u8fc7\u7a0b\u3002<\/p>\n<p><strong>\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u9700\u8981\u54ea\u4e9bPython\u5e93\uff1f<\/strong><br \/>\u5b9e\u73b0\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u7684\u529f\u80fd\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9Matplotlib\u3001Turtle\u6216Pygame\u7b49\u5e93\u3002Matplotlib\u9002\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\uff0cTurtle\u975e\u5e38\u9002\u5408\u521d\u5b66\u8005\uff0c\u63d0\u4f9b\u4e86\u7b80\u5355\u7684\u7ed8\u56fe\u547d\u4ee4\uff0c\u800cPygame\u5219\u9002\u5408\u9700\u8981\u66f4\u591a\u56fe\u5f62\u5904\u7406\u529f\u80fd\u7684\u9879\u76ee\u3002\u6839\u636e\u60a8\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e93\u3002<\/p>\n<p><strong>\u5982\u4f55\u81ea\u5b9a\u4e49\u4e94\u89d2\u661f\u7684\u989c\u8272\u548c\u5927\u5c0f\uff1f<\/strong><br \/>\u5728\u4f7f\u7528Matplotlib\u7ed8\u5236\u4e94\u89d2\u661f\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u53c2\u6570\u6765\u6539\u53d8\u989c\u8272\u548c\u5927\u5c0f\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>fill<\/code>\u65b9\u6cd5\u53ef\u4ee5\u6307\u5b9a\u989c\u8272\uff0c\u800c\u901a\u8fc7<code>marker<\/code>\u548c<code>markersize<\/code>\u53c2\u6570\u53ef\u4ee5\u8c03\u6574\u5927\u5c0f\u3002\u5728Turtle\u5e93\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>fillcolor()<\/code>\u51fd\u6570\u8bbe\u7f6e\u989c\u8272\uff0c\u5e76\u901a\u8fc7<code>shapesize()<\/code>\u51fd\u6570\u8c03\u6574\u7ed8\u56fe\u7684\u5927\u5c0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u4f55\u7528Python\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f \u7528Python\u7ed8\u5236\u5b9e\u5fc3\u4e94\u89d2\u661f\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Turtle\u6a21\u5757\u3001\u5229\u7528Matpl [&hellip;]","protected":false},"author":3,"featured_media":1124435,"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\/1124426"}],"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=1124426"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1124426\/revisions"}],"predecessor-version":[{"id":1124436,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1124426\/revisions\/1124436"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1124435"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1124426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1124426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1124426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}