{"id":1188497,"date":"2025-01-15T20:18:06","date_gmt":"2025-01-15T12:18:06","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1188497.html"},"modified":"2025-01-15T20:18:08","modified_gmt":"2025-01-15T12:18:08","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8python%e9%87%8c%e7%94%bb%e6%a4%ad%e5%9c%86","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1188497.html","title":{"rendered":"\u5982\u4f55\u5728python\u91cc\u753b\u692d\u5706"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25140802\/a82a5964-4087-4dd3-8d26-1ef80016c5a4.webp\" alt=\"\u5982\u4f55\u5728python\u91cc\u753b\u692d\u5706\" \/><\/p>\n<p><p> <strong>\u8981\u5728Python\u4e2d\u7ed8\u5236\u692d\u5706\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5e93\uff0c\u4f8b\u5982matplotlib\u3001opencv\u548cpygame\u7b49\u3002\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528matplotlib\u5e93\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528matplotlib\u5e93\u7ed8\u5236\u692d\u5706\u3001\u8bbe\u7f6e\u692d\u5706\u7684\u53c2\u6570\u548c\u989c\u8272\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u56fe\u5f62\u4e2d\u6dfb\u52a0\u5176\u4ed6\u5143\u7d20\u3002<\/strong><\/p>\n<\/p>\n<p><p><strong>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5b89\u88c5matplotlib\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4f7f\u7528matplotlib\u6765\u7ed8\u5236\u692d\u5706\u3002<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u8bbe\u7f6e\u692d\u5706\u7684\u53c2\u6570<\/strong><\/h2>\n<p>center = (0, 0)  # \u692d\u5706\u7684\u4e2d\u5fc3<\/p>\n<p>width = 4       # \u692d\u5706\u7684\u5bbd\u5ea6<\/p>\n<p>height = 2      # \u692d\u5706\u7684\u9ad8\u5ea6<\/p>\n<p>angle = 0       # \u692d\u5706\u7684\u65cb\u8f6c\u89d2\u5ea6<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u692d\u5706\u5f62\u72b6<\/strong><\/h2>\n<p>ellipse = plt.matplotlib.patches.Ellipse(center, width, height, angle=angle, edgecolor=&#39;r&#39;, fc=&#39;None&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62<\/strong><\/h2>\n<p>fig, ax = plt.subplots(subplot_kw={&#39;aspect&#39;: &#39;equal&#39;})<\/p>\n<h2><strong>\u6dfb\u52a0\u692d\u5706\u5230\u56fe\u5f62\u4e2d<\/strong><\/h2>\n<p>ax.add_patch(ellipse)<\/p>\n<h2><strong>\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4<\/strong><\/h2>\n<p>ax.set_xlim(-5, 5)<\/p>\n<p>ax.set_ylim(-5, 5)<\/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>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528\u4e86matplotlib\u5e93\u4e2d\u7684patches\u6a21\u5757\u6765\u521b\u5efa\u4e00\u4e2a\u692d\u5706\u5f62\u72b6\u3002\u6211\u4eec\u5b9a\u4e49\u4e86\u692d\u5706\u7684\u4e2d\u5fc3\u3001\u5bbd\u5ea6\u3001\u9ad8\u5ea6\u548c\u65cb\u8f6c\u89d2\u5ea6\uff0c\u7136\u540e\u5c06\u692d\u5706\u6dfb\u52a0\u5230\u56fe\u5f62\u4e2d\uff0c\u5e76\u8bbe\u7f6e\u4e86\u56fe\u5f62\u7684\u8303\u56f4\u3002\u6700\u540e\uff0c\u4f7f\u7528plt.show()\u51fd\u6570\u6765\u663e\u793a\u56fe\u5f62\u3002<\/strong><\/p>\n<\/p>\n<p><p><strong>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u5176\u4ed6\u5e93\uff08\u4f8b\u5982opencv\u548cpygame\uff09\u6765\u7ed8\u5236\u692d\u5706\u3002<\/strong><\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u4f7f\u7528OpenCV\u7ed8\u5236\u692d\u5706<\/h2>\n<\/p>\n<p><p><strong>OpenCV\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5e93\uff0c\u5177\u6709\u8bb8\u591a\u56fe\u50cf\u5904\u7406\u529f\u80fd\u3002\u8981\u4f7f\u7528OpenCV\u7ed8\u5236\u692d\u5706\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5OpenCV\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install opencv-python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u6765\u7ed8\u5236\u692d\u5706\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u7a7a\u767d\u56fe\u50cf<\/strong><\/h2>\n<p>image = np.zeros((500, 500, 3), dtype=np.uint8)<\/p>\n<h2><strong>\u8bbe\u7f6e\u692d\u5706\u7684\u53c2\u6570<\/strong><\/h2>\n<p>center = (250, 250)  # \u692d\u5706\u7684\u4e2d\u5fc3<\/p>\n<p>axes = (100, 50)     # \u692d\u5706\u7684\u957f\u8f74\u548c\u77ed\u8f74<\/p>\n<p>angle = 30           # \u692d\u5706\u7684\u65cb\u8f6c\u89d2\u5ea6<\/p>\n<p>startAngle = 0       # \u692d\u5706\u5f27\u7684\u8d77\u59cb\u89d2\u5ea6<\/p>\n<p>endAngle = 360       # \u692d\u5706\u5f27\u7684\u7ed3\u675f\u89d2\u5ea6<\/p>\n<p>color = (0, 255, 0)  # \u692d\u5706\u7684\u989c\u8272 (B, G, R)<\/p>\n<p>thickness = 2        # \u692d\u5706\u7684\u7ebf\u6761\u5bbd\u5ea6<\/p>\n<h2><strong>\u7ed8\u5236\u692d\u5706<\/strong><\/h2>\n<p>cv2.ellipse(image, center, axes, angle, startAngle, endAngle, color, thickness)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>cv2.imshow(&#39;Ellipse&#39;, image)<\/p>\n<p>cv2.w<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>tKey(0)<\/p>\n<p>cv2.destroyAllWindows()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528\u4e86OpenCV\u5e93\u4e2d\u7684ellipse\u51fd\u6570\u6765\u7ed8\u5236\u692d\u5706\u3002\u6211\u4eec\u5b9a\u4e49\u4e86\u692d\u5706\u7684\u4e2d\u5fc3\u3001\u957f\u8f74\u548c\u77ed\u8f74\u3001\u65cb\u8f6c\u89d2\u5ea6\u3001\u8d77\u59cb\u89d2\u5ea6\u548c\u7ed3\u675f\u89d2\u5ea6\u3001\u989c\u8272\u548c\u7ebf\u6761\u5bbd\u5ea6\u3002\u7136\u540e\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u7a7a\u767d\u56fe\u50cf\uff0c\u5e76\u5728\u56fe\u50cf\u4e0a\u7ed8\u5236\u692d\u5706\uff0c\u6700\u540e\u663e\u793a\u56fe\u50cf\u3002<\/strong><\/p>\n<\/p>\n<p><h2>\u4e8c\u3001\u4f7f\u7528Pygame\u7ed8\u5236\u692d\u5706<\/h2>\n<\/p>\n<p><p><strong>Pygame\u662f\u4e00\u4e2a\u7528\u4e8e\u5f00\u53d1\u6e38\u620f\u7684\u5e93\uff0c\u5177\u6709\u8bb8\u591a\u7ed8\u56fe\u529f\u80fd\u3002\u8981\u4f7f\u7528Pygame\u7ed8\u5236\u692d\u5706\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5Pygame\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pygame<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u6765\u7ed8\u5236\u692d\u5706\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pygame<\/p>\n<p>import sys<\/p>\n<h2><strong>\u521d\u59cb\u5316Pygame<\/strong><\/h2>\n<p>pygame.init()<\/p>\n<h2><strong>\u8bbe\u7f6e\u7a97\u53e3\u5927\u5c0f<\/strong><\/h2>\n<p>size = (500, 500)<\/p>\n<p>screen = pygame.display.set_mode(size)<\/p>\n<h2><strong>\u8bbe\u7f6e\u989c\u8272<\/strong><\/h2>\n<p>white = (255, 255, 255)<\/p>\n<p>green = (0, 255, 0)<\/p>\n<h2><strong>\u8bbe\u7f6e\u692d\u5706\u7684\u53c2\u6570<\/strong><\/h2>\n<p>rect = pygame.Rect(150, 200, 200, 100)  # \u692d\u5706\u7684\u5916\u63a5\u77e9\u5f62<\/p>\n<h2><strong>\u4e3b\u5faa\u73af<\/strong><\/h2>\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>    # \u586b\u5145\u80cc\u666f\u989c\u8272<\/p>\n<p>    screen.fill(white)<\/p>\n<p>    # \u7ed8\u5236\u692d\u5706<\/p>\n<p>    pygame.draw.ellipse(screen, green, rect, 2)<\/p>\n<p>    # \u66f4\u65b0\u663e\u793a<\/p>\n<p>    pygame.display.flip()<\/p>\n<h2><strong>\u9000\u51faPygame<\/strong><\/h2>\n<p>pygame.quit()<\/p>\n<p>sys.exit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528\u4e86Pygame\u5e93\u4e2d\u7684draw.ellipse\u51fd\u6570\u6765\u7ed8\u5236\u692d\u5706\u3002\u6211\u4eec\u5b9a\u4e49\u4e86\u692d\u5706\u7684\u5916\u63a5\u77e9\u5f62\uff0c\u7136\u540e\u5728\u4e3b\u5faa\u73af\u4e2d\u586b\u5145\u80cc\u666f\u989c\u8272\uff0c\u5e76\u5728\u5c4f\u5e55\u4e0a\u7ed8\u5236\u692d\u5706\uff0c\u6700\u540e\u66f4\u65b0\u663e\u793a\u3002\u5728\u7528\u6237\u5173\u95ed\u7a97\u53e3\u65f6\uff0c\u9000\u51faPygame\u3002<\/strong><\/p>\n<\/p>\n<p><h2>\u4e09\u3001\u4f7f\u7528Matplotlib\u7ed8\u5236\u5e26\u6709\u4e0d\u540c\u6837\u5f0f\u7684\u692d\u5706<\/h2>\n<\/p>\n<p><p><strong>\u9664\u4e86\u7b80\u5355\u7684\u692d\u5706\u7ed8\u5236\uff0cmatplotlib\u8fd8\u53ef\u4ee5\u7ed8\u5236\u5e26\u6709\u4e0d\u540c\u6837\u5f0f\u7684\u692d\u5706\uff0c\u4f8b\u5982\u586b\u5145\u989c\u8272\u3001\u865a\u7ebf\u8fb9\u6846\u7b49\u3002<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u8bbe\u7f6e\u692d\u5706\u7684\u53c2\u6570<\/strong><\/h2>\n<p>center = (0, 0)<\/p>\n<p>width = 4<\/p>\n<p>height = 2<\/p>\n<p>angle = 45<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u692d\u5706\u5f62\u72b6<\/strong><\/h2>\n<p>ellipse = plt.matplotlib.patches.Ellipse(center, width, height, angle=angle, edgecolor=&#39;b&#39;, facecolor=&#39;yellow&#39;, linestyle=&#39;--&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62<\/strong><\/h2>\n<p>fig, ax = plt.subplots(subplot_kw={&#39;aspect&#39;: &#39;equal&#39;})<\/p>\n<h2><strong>\u6dfb\u52a0\u692d\u5706\u5230\u56fe\u5f62\u4e2d<\/strong><\/h2>\n<p>ax.add_patch(ellipse)<\/p>\n<h2><strong>\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4<\/strong><\/h2>\n<p>ax.set_xlim(-5, 5)<\/p>\n<p>ax.set_ylim(-5, 5)<\/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>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528\u4e86matplotlib\u5e93\u4e2d\u7684patches\u6a21\u5757\u6765\u521b\u5efa\u4e00\u4e2a\u5e26\u6709\u4e0d\u540c\u6837\u5f0f\u7684\u692d\u5706\u3002\u6211\u4eec\u8bbe\u7f6e\u4e86\u692d\u5706\u7684\u8fb9\u6846\u989c\u8272\u3001\u586b\u5145\u989c\u8272\u548c\u7ebf\u6761\u6837\u5f0f\u3002\u7136\u540e\uff0c\u5c06\u692d\u5706\u6dfb\u52a0\u5230\u56fe\u5f62\u4e2d\uff0c\u5e76\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4\uff0c\u6700\u540e\u663e\u793a\u56fe\u5f62\u3002<\/strong><\/p>\n<\/p>\n<p><h2>\u56db\u3001\u4f7f\u7528Matplotlib\u7ed8\u5236\u591a\u4e2a\u692d\u5706<\/h2>\n<\/p>\n<p><p><strong>\u6709\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5728\u540c\u4e00\u4e2a\u56fe\u5f62\u4e2d\u7ed8\u5236\u591a\u4e2a\u692d\u5706\u3002\u53ef\u4ee5\u4f7f\u7528matplotlib\u5e93\u6765\u5b9e\u73b0\u3002<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u5b9a\u4e49\u692d\u5706\u7684\u53c2\u6570<\/strong><\/h2>\n<p>ellipses_params = [<\/p>\n<p>    {&#39;center&#39;: (0, 0), &#39;width&#39;: 4, &#39;height&#39;: 2, &#39;angle&#39;: 0, &#39;edgecolor&#39;: &#39;r&#39;, &#39;facecolor&#39;: &#39;none&#39;},<\/p>\n<p>    {&#39;center&#39;: (1, 1), &#39;width&#39;: 3, &#39;height&#39;: 1.5, &#39;angle&#39;: 30, &#39;edgecolor&#39;: &#39;g&#39;, &#39;facecolor&#39;: &#39;none&#39;},<\/p>\n<p>    {&#39;center&#39;: (-2, -1), &#39;width&#39;: 5, &#39;height&#39;: 2.5, &#39;angle&#39;: 60, &#39;edgecolor&#39;: &#39;b&#39;, &#39;facecolor&#39;: &#39;none&#39;}<\/p>\n<p>]<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62<\/strong><\/h2>\n<p>fig, ax = plt.subplots(subplot_kw={&#39;aspect&#39;: &#39;equal&#39;})<\/p>\n<h2><strong>\u6dfb\u52a0\u591a\u4e2a\u692d\u5706\u5230\u56fe\u5f62\u4e2d<\/strong><\/h2>\n<p>for params in ellipses_params:<\/p>\n<p>    ellipse = plt.matplotlib.patches.Ellipse(<\/p>\n<p>        xy=params[&#39;center&#39;],<\/p>\n<p>        width=params[&#39;width&#39;],<\/p>\n<p>        height=params[&#39;height&#39;],<\/p>\n<p>        angle=params[&#39;angle&#39;],<\/p>\n<p>        edgecolor=params[&#39;edgecolor&#39;],<\/p>\n<p>        facecolor=params[&#39;facecolor&#39;]<\/p>\n<p>    )<\/p>\n<p>    ax.add_patch(ellipse)<\/p>\n<h2><strong>\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4<\/strong><\/h2>\n<p>ax.set_xlim(-6, 6)<\/p>\n<p>ax.set_ylim(-6, 6)<\/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>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u5b9a\u4e49\u4e86\u591a\u4e2a\u692d\u5706\u7684\u53c2\u6570\uff0c\u5e76\u4f7f\u7528\u5faa\u73af\u5c06\u8fd9\u4e9b\u692d\u5706\u6dfb\u52a0\u5230\u56fe\u5f62\u4e2d\u3002\u6211\u4eec\u8bbe\u7f6e\u4e86\u6bcf\u4e2a\u692d\u5706\u7684\u4e2d\u5fc3\u3001\u5bbd\u5ea6\u3001\u9ad8\u5ea6\u3001\u65cb\u8f6c\u89d2\u5ea6\u3001\u8fb9\u6846\u989c\u8272\u548c\u586b\u5145\u989c\u8272\u3002\u7136\u540e\uff0c\u5c06\u692d\u5706\u6dfb\u52a0\u5230\u56fe\u5f62\u4e2d\uff0c\u5e76\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4\uff0c\u6700\u540e\u663e\u793a\u56fe\u5f62\u3002<\/strong><\/p>\n<\/p>\n<p><h2>\u4e94\u3001\u4f7f\u7528Matplotlib\u7ed8\u5236\u692d\u5706\u548c\u5176\u4ed6\u5f62\u72b6<\/h2>\n<\/p>\n<p><p><strong>\u6709\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5728\u540c\u4e00\u4e2a\u56fe\u5f62\u4e2d\u7ed8\u5236\u692d\u5706\u548c\u5176\u4ed6\u5f62\u72b6\uff0c\u4f8b\u5982\u77e9\u5f62\u3001\u5706\u5f62\u7b49\u3002\u53ef\u4ee5\u4f7f\u7528matplotlib\u5e93\u6765\u5b9e\u73b0\u3002<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u8bbe\u7f6e\u692d\u5706\u7684\u53c2\u6570<\/strong><\/h2>\n<p>ellipse_center = (0, 0)<\/p>\n<p>ellipse_width = 4<\/p>\n<p>ellipse_height = 2<\/p>\n<p>ellipse_angle = 30<\/p>\n<h2><strong>\u8bbe\u7f6e\u77e9\u5f62\u7684\u53c2\u6570<\/strong><\/h2>\n<p>rect_x = -2<\/p>\n<p>rect_y = -1<\/p>\n<p>rect_width = 4<\/p>\n<p>rect_height = 2<\/p>\n<h2><strong>\u8bbe\u7f6e\u5706\u5f62\u7684\u53c2\u6570<\/strong><\/h2>\n<p>circle_center = (2, 2)<\/p>\n<p>circle_radius = 1<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62<\/strong><\/h2>\n<p>fig, ax = plt.subplots(subplot_kw={&#39;aspect&#39;: &#39;equal&#39;})<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u6dfb\u52a0\u692d\u5706\u5230\u56fe\u5f62\u4e2d<\/strong><\/h2>\n<p>ellipse = plt.matplotlib.patches.Ellipse(ellipse_center, ellipse_width, ellipse_height, angle=ellipse_angle, edgecolor=&#39;r&#39;, facecolor=&#39;none&#39;)<\/p>\n<p>ax.add_patch(ellipse)<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u6dfb\u52a0\u77e9\u5f62\u5230\u56fe\u5f62\u4e2d<\/strong><\/h2>\n<p>rect = plt.matplotlib.patches.Rectangle((rect_x, rect_y), rect_width, rect_height, edgecolor=&#39;g&#39;, facecolor=&#39;none&#39;)<\/p>\n<p>ax.add_patch(rect)<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u6dfb\u52a0\u5706\u5f62\u5230\u56fe\u5f62\u4e2d<\/strong><\/h2>\n<p>circle = plt.matplotlib.patches.Circle(circle_center, circle_radius, edgecolor=&#39;b&#39;, facecolor=&#39;none&#39;)<\/p>\n<p>ax.add_patch(circle)<\/p>\n<h2><strong>\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4<\/strong><\/h2>\n<p>ax.set_xlim(-5, 5)<\/p>\n<p>ax.set_ylim(-5, 5)<\/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>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u5b9a\u4e49\u4e86\u692d\u5706\u3001\u77e9\u5f62\u548c\u5706\u5f62\u7684\u53c2\u6570\uff0c\u5e76\u4f7f\u7528matplotlib\u5e93\u4e2d\u7684patches\u6a21\u5757\u5206\u522b\u521b\u5efa\u8fd9\u4e9b\u5f62\u72b6\u3002\u7136\u540e\uff0c\u5c06\u8fd9\u4e9b\u5f62\u72b6\u6dfb\u52a0\u5230\u540c\u4e00\u4e2a\u56fe\u5f62\u4e2d\uff0c\u5e76\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4\uff0c\u6700\u540e\u663e\u793a\u56fe\u5f62\u3002<\/strong><\/p>\n<\/p>\n<p><h2>\u516d\u3001\u4f7f\u7528Matplotlib\u52a8\u6001\u7ed8\u5236\u692d\u5706<\/h2>\n<\/p>\n<p><p><strong>\u6709\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u52a8\u6001\u7ed8\u5236\u692d\u5706\uff0c\u4f8b\u5982\u5728\u52a8\u753b\u4e2d\u3002\u53ef\u4ee5\u4f7f\u7528matplotlib\u5e93\u6765\u5b9e\u73b0\u3002<\/strong><\/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.animation import FuncAnimation<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62<\/strong><\/h2>\n<p>fig, ax = plt.subplots(subplot_kw={&#39;aspect&#39;: &#39;equal&#39;})<\/p>\n<h2><strong>\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4<\/strong><\/h2>\n<p>ax.set_xlim(-5, 5)<\/p>\n<p>ax.set_ylim(-5, 5)<\/p>\n<h2><strong>\u521d\u59cb\u5316\u692d\u5706<\/strong><\/h2>\n<p>ellipse = plt.matplotlib.patches.Ellipse((0, 0), 4, 2, angle=0, edgecolor=&#39;r&#39;, facecolor=&#39;none&#39;)<\/p>\n<p>ax.add_patch(ellipse)<\/p>\n<h2><strong>\u52a8\u753b\u66f4\u65b0\u51fd\u6570<\/strong><\/h2>\n<p>def update(frame):<\/p>\n<p>    angle = frame % 360<\/p>\n<p>    ellipse.set_angle(angle)<\/p>\n<p>    return ellipse,<\/p>\n<h2><strong>\u521b\u5efa\u52a8\u753b<\/strong><\/h2>\n<p>ani = FuncAnimation(fig, update, frames=np.arange(0, 360, 1), interval=20, blit=True)<\/p>\n<h2><strong>\u663e\u793a\u52a8\u753b<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528matplotlib\u5e93\u4e2d\u7684FuncAnimation\u51fd\u6570\u6765\u521b\u5efa\u52a8\u753b\u3002\u6211\u4eec\u5b9a\u4e49\u4e86\u4e00\u4e2a\u66f4\u65b0\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u66f4\u65b0\u692d\u5706\u7684\u65cb\u8f6c\u89d2\u5ea6\u3002\u7136\u540e\uff0c\u4f7f\u7528FuncAnimation\u51fd\u6570\u521b\u5efa\u52a8\u753b\uff0c\u5e76\u8bbe\u7f6e\u52a8\u753b\u7684\u5e27\u6570\u548c\u95f4\u9694\u65f6\u95f4\uff0c\u6700\u540e\u663e\u793a\u52a8\u753b\u3002<\/strong><\/p>\n<\/p>\n<p><h2>\u4e03\u3001\u4f7f\u7528Matplotlib\u7ed8\u5236\u5e26\u6709\u900f\u660e\u5ea6\u7684\u692d\u5706<\/h2>\n<\/p>\n<p><p><strong>\u6709\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u7ed8\u5236\u5e26\u6709\u900f\u660e\u5ea6\u7684\u692d\u5706\uff0c\u53ef\u4ee5\u4f7f\u7528matplotlib\u5e93\u6765\u5b9e\u73b0\u3002<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u8bbe\u7f6e\u692d\u5706\u7684\u53c2\u6570<\/strong><\/h2>\n<p>center = (0, 0)<\/p>\n<p>width = 4<\/p>\n<p>height = 2<\/p>\n<p>angle = 0<\/p>\n<p>alpha = 0.5  # \u900f\u660e\u5ea6<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u692d\u5706\u5f62\u72b6<\/strong><\/h2>\n<p>ellipse = plt.matplotlib.patches.Ellipse(center, width, height, angle=angle, edgecolor=&#39;r&#39;, facecolor=&#39;blue&#39;, alpha=alpha)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62<\/strong><\/h2>\n<p>fig, ax = plt.subplots(subplot_kw={&#39;aspect&#39;: &#39;equal&#39;})<\/p>\n<h2><strong>\u6dfb\u52a0\u692d\u5706\u5230\u56fe\u5f62\u4e2d<\/strong><\/h2>\n<p>ax.add_patch(ellipse)<\/p>\n<h2><strong>\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4<\/strong><\/h2>\n<p>ax.set_xlim(-5, 5)<\/p>\n<p>ax.set_ylim(-5, 5)<\/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>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528matplotlib\u5e93\u4e2d\u7684patches\u6a21\u5757\u6765\u521b\u5efa\u4e00\u4e2a\u5e26\u6709\u900f\u660e\u5ea6\u7684\u692d\u5706\u3002\u6211\u4eec\u8bbe\u7f6e\u4e86\u692d\u5706\u7684\u900f\u660e\u5ea6\u53c2\u6570alpha\uff0c\u7136\u540e\u5c06\u692d\u5706\u6dfb\u52a0\u5230\u56fe\u5f62\u4e2d\uff0c\u5e76\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4\uff0c\u6700\u540e\u663e\u793a\u56fe\u5f62\u3002<\/strong><\/p>\n<\/p>\n<p><h2>\u516b\u3001\u4f7f\u7528Matplotlib\u7ed8\u5236\u692d\u5706\u548c\u6dfb\u52a0\u6587\u672c<\/h2>\n<\/p>\n<p><p><strong>\u6709\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5728\u56fe\u5f62\u4e2d\u6dfb\u52a0\u6587\u672c\u6ce8\u91ca\uff0c\u53ef\u4ee5\u4f7f\u7528matplotlib\u5e93\u6765\u5b9e\u73b0\u3002<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u8bbe\u7f6e\u692d\u5706\u7684\u53c2\u6570<\/strong><\/h2>\n<p>center = (0, 0)<\/p>\n<p>width = 4<\/p>\n<p>height = 2<\/p>\n<p>angle = 0<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u692d\u5706\u5f62\u72b6<\/strong><\/h2>\n<p>ellipse = plt.matplotlib.patches.Ellipse(center, width, height, angle=angle, edgecolor=&#39;r&#39;, facecolor=&#39;none&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62<\/strong><\/h2>\n<p>fig, ax = plt.subplots(subplot_kw={&#39;aspect&#39;: &#39;equal&#39;})<\/p>\n<h2><strong>\u6dfb\u52a0\u692d\u5706\u5230\u56fe\u5f62\u4e2d<\/strong><\/h2>\n<p>ax.add_patch(ellipse)<\/p>\n<h2><strong>\u6dfb\u52a0\u6587\u672c\u6ce8\u91ca<\/strong><\/h2>\n<p>ax.text(0, 0, &#39;Center&#39;, horizontalalignment=&#39;center&#39;, verticalalignment=&#39;center&#39;, fontsize=12, color=&#39;black&#39;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4<\/strong><\/h2>\n<p>ax.set_xlim(-5, 5)<\/p>\n<p>ax.set_ylim(-5, 5)<\/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>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528matplotlib\u5e93\u4e2d\u7684text\u51fd\u6570\u5728\u56fe\u5f62\u4e2d\u6dfb\u52a0\u6587\u672c\u6ce8\u91ca\u3002\u6211\u4eec\u8bbe\u7f6e\u4e86\u6587\u672c\u7684\u4f4d\u7f6e\u3001\u5bf9\u9f50\u65b9\u5f0f\u3001\u5b57\u4f53\u5927\u5c0f\u548c\u989c\u8272\uff0c\u7136\u540e\u5c06\u6587\u672c\u6dfb\u52a0\u5230\u56fe\u5f62\u4e2d\uff0c\u5e76\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4\uff0c\u6700\u540e\u663e\u793a\u56fe\u5f62\u3002<\/strong><\/p>\n<\/p>\n<p><h2>\u4e5d\u3001\u4f7f\u7528Matplotlib\u7ed8\u5236\u692d\u5706\u548c\u6dfb\u52a0\u7bad\u5934<\/h2>\n<\/p>\n<p><p><strong>\u6709\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5728\u56fe\u5f62\u4e2d\u6dfb\u52a0\u7bad\u5934\uff0c\u53ef\u4ee5\u4f7f\u7528matplotlib\u5e93\u6765\u5b9e\u73b0\u3002<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u8bbe\u7f6e\u692d\u5706\u7684\u53c2\u6570<\/strong><\/h2>\n<p>center = (0, 0)<\/p>\n<p>width = 4<\/p>\n<p>height = 2<\/p>\n<p>angle = 0<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u692d\u5706\u5f62\u72b6<\/strong><\/h2>\n<p>ellipse = plt.matplotlib.patches.Ellipse(center, width, height, angle=angle, edgecolor=&#39;r&#39;, facecolor=&#39;none&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u56fe\u5f62<\/strong><\/h2>\n<p>fig, ax = plt.subplots(subplot_kw={&#39;aspect&#39;: &#39;equal&#39;})<\/p>\n<h2><strong>\u6dfb\u52a0\u692d\u5706\u5230\u56fe\u5f62\u4e2d<\/strong><\/h2>\n<p>ax.add_patch(ellipse)<\/p>\n<h2><strong>\u6dfb\u52a0\u7bad\u5934<\/strong><\/h2>\n<p>ax.arrow(0, 0, 2, 1, head_width=0.2, head_length=0.3, fc=&#39;blue&#39;, ec=&#39;blue&#39;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4<\/strong><\/h2>\n<p>ax.set_xlim(-5, 5)<\/p>\n<p>ax.set_ylim(-5, 5)<\/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>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528matplotlib\u5e93\u4e2d\u7684arrow\u51fd\u6570\u5728\u56fe\u5f62\u4e2d\u6dfb\u52a0\u7bad\u5934\u3002\u6211\u4eec\u8bbe\u7f6e\u4e86\u7bad\u5934\u7684\u8d77\u59cb\u4f4d\u7f6e\u3001\u65b9\u5411\u3001\u7bad\u5934\u5934\u90e8\u7684\u5bbd\u5ea6\u548c\u957f\u5ea6\u3001\u989c\u8272\u7b49\uff0c\u7136\u540e\u5c06\u7bad\u5934\u6dfb\u52a0\u5230\u56fe\u5f62\u4e2d\uff0c\u5e76\u8bbe\u7f6e\u56fe\u5f62\u7684\u8303\u56f4\uff0c\u6700\u540e\u663e\u793a\u56fe\u5f62\u3002<\/strong><\/p>\n<\/p>\n<p><p><strong>\u603b\u7ed3<\/strong><\/p>\n<\/p>\n<p><p><strong>\u5728Python\u4e2d\u7ed8\u5236\u692d\u5706\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u6700\u5e38\u7528\u7684\u662f\u4f7f\u7528matplotlib\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u4e0d\u540c\u7684\u53c2\u6570\u6765\u7ed8\u5236\u4e0d\u540c\u6837\u5f0f\u7684\u692d\u5706\uff0c\u4f8b\u5982\u586b\u5145\u989c\u8272\u3001\u865a\u7ebf\u8fb9\u6846\u7b49\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528opencv\u548cpygame\u5e93\u6765\u7ed8\u5236\u692d\u5706\uff0c\u4ee5\u53ca\u5728\u56fe\u5f62\u4e2d\u6dfb\u52a0\u5176\u4ed6\u5143\u7d20\uff0c\u4f8b\u5982\u77e9\u5f62\u3001\u5706\u5f62\u3001\u6587\u672c\u6ce8\u91ca\u548c\u7bad\u5934\u7b49\u3002\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u7ed8\u5236\u5404\u79cd\u590d\u6742\u7684\u56fe\u5f62\u3002<\/strong><\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528\u4e0d\u540c\u5e93\u7ed8\u5236\u692d\u5706\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5e93\u6765\u7ed8\u5236\u692d\u5706\u3002\u5e38\u89c1\u7684\u5e93\u5305\u62ecMatplotlib\u548cPygame\u3002Matplotlib\u975e\u5e38\u9002\u5408\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u53ef\u89c6\u5316\uff0c\u53ef\u4ee5\u901a\u8fc7<code>Ellipse<\/code>\u7c7b\u8f7b\u677e\u7ed8\u5236\u692d\u5706\u3002Pygame\u5219\u9002\u5408\u4e8e\u6e38\u620f\u5f00\u53d1\u548c\u56fe\u5f62\u5e94\u7528\uff0c\u4f7f\u7528<code>draw.ellipse()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u692d\u5706\u7684\u7ed8\u5236\u3002\u9009\u62e9\u54ea\u4e2a\u5e93\u53d6\u51b3\u4e8e\u4f60\u7684\u5177\u4f53\u9700\u6c42\u548c\u5e94\u7528\u573a\u666f\u3002<\/p>\n<p><strong>\u7ed8\u5236\u692d\u5706\u65f6\u5982\u4f55\u63a7\u5236\u5176\u989c\u8272\u548c\u7ebf\u6761\u6837\u5f0f\uff1f<\/strong><br \/>\u5728Matplotlib\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e<code>edgecolor<\/code>\u548c<code>facecolor<\/code>\u53c2\u6570\u6765\u63a7\u5236\u692d\u5706\u7684\u989c\u8272\uff0c\u6b64\u5916\u8fd8\u53ef\u4ee5\u901a\u8fc7<code>linestyle<\/code>\u53c2\u6570\u8c03\u6574\u7ebf\u6761\u6837\u5f0f\uff0c\u4f8b\u5982\u865a\u7ebf\u6216\u5b9e\u7ebf\u3002\u5728Pygame\u4e2d\uff0c\u989c\u8272\u901a\u8fc7RGB\u683c\u5f0f\u6307\u5b9a\uff0c\u7ebf\u6761\u6837\u5f0f\u5219\u53ef\u4ee5\u901a\u8fc7\u7ed8\u5236\u4e0d\u540c\u7684\u5f62\u72b6\u6765\u5b9e\u73b0\u3002<\/p>\n<p><strong>\u692d\u5706\u7684\u5750\u6807\u7cfb\u662f\u5982\u4f55\u5b9a\u4e49\u7684\uff0c\u5982\u4f55\u8bbe\u7f6e\u5176\u4f4d\u7f6e\u548c\u5927\u5c0f\uff1f<\/strong><br \/>\u5728Matplotlib\u4e2d\uff0c\u692d\u5706\u7684\u4e2d\u5fc3\u70b9\u548c\u957f\u77ed\u8f74\u7684\u957f\u5ea6\u901a\u8fc7<code>xy<\/code>\u3001<code>width<\/code>\u548c<code>height<\/code>\u53c2\u6570\u8fdb\u884c\u5b9a\u4e49\u3002<code>xy<\/code>\u6307\u5b9a\u692d\u5706\u7684\u4e2d\u5fc3\u5750\u6807\uff0c<code>width<\/code>\u4e3a\u692d\u5706\u7684\u957f\u8f74\u957f\u5ea6\uff0c<code>height<\/code>\u4e3a\u77ed\u8f74\u957f\u5ea6\u3002\u5728Pygame\u4e2d\uff0c\u692d\u5706\u7684\u4f4d\u7f6e\u548c\u5927\u5c0f\u901a\u8fc7\u4f20\u9012\u4e00\u4e2a\u77e9\u5f62\u6846\u7684\u53c2\u6570\uff0c\u77e9\u5f62\u6846\u7684\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u51b3\u5b9a\u4e86\u692d\u5706\u7684\u5927\u5c0f\u4e0e\u4f4d\u7f6e\u3002\u4f7f\u7528\u8fd9\u4e9b\u53c2\u6570\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u8bbe\u7f6e\u692d\u5706\u7684\u5916\u89c2\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u7ed8\u5236\u692d\u5706\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5e93\uff0c\u4f8b\u5982matplotlib\u3001opencv\u548cpygame\u7b49\u3002\u6700\u5e38\u7528\u7684\u65b9 [&hellip;]","protected":false},"author":3,"featured_media":1188500,"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\/1188497"}],"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=1188497"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1188497\/revisions"}],"predecessor-version":[{"id":1188501,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1188497\/revisions\/1188501"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1188500"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1188497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1188497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1188497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}