{"id":1038302,"date":"2024-12-31T12:22:50","date_gmt":"2024-12-31T04:22:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1038302.html"},"modified":"2024-12-31T12:22:53","modified_gmt":"2024-12-31T04:22:53","slug":"%e5%a6%82%e4%bd%95%e4%bf%9d%e5%ad%98python%e7%94%bb%e7%9a%84%e5%9b%be%e7%89%87%e6%a0%bc%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1038302.html","title":{"rendered":"\u5982\u4f55\u4fdd\u5b58python\u753b\u7684\u56fe\u7247\u683c\u5f0f"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/72574bd2-6d17-42de-9013-07a1b89b27f4.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u5982\u4f55\u4fdd\u5b58python\u753b\u7684\u56fe\u7247\u683c\u5f0f\" \/><\/p>\n<p><p> <strong>\u8981\u4fdd\u5b58Python\u753b\u7684\u56fe\u7247\u683c\u5f0f\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a\u4f7f\u7528matplotlib\u5e93\u7684savefig\u51fd\u6570\u3001\u4f7f\u7528Pillow\u5e93\u7684save\u51fd\u6570\u3001\u4f7f\u7528OpenCV\u5e93\u7684imwrite\u51fd\u6570<\/strong>\u3002\u5176\u4e2d\uff0c\u4f7f\u7528matplotlib\u5e93\u7684savefig\u51fd\u6570\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4f7f\u7528matplotlib\u5e93\u7684savefig\u51fd\u6570\u4fdd\u5b58\u56fe\u7247\u662f\u4e00\u79cd\u975e\u5e38\u7b80\u5355\u4e14\u9ad8\u6548\u7684\u65b9\u6cd5\u3002matplotlib\u5e93\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u7ed8\u56fe\u5e93\u4e4b\u4e00\uff0c\u5b83\u63d0\u4f9b\u4e86\u8bb8\u591a\u5f3a\u5927\u7684\u7ed8\u56fe\u5de5\u5177\u548c\u51fd\u6570\u3002\u4f7f\u7528savefig\u51fd\u6570\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06\u7ed8\u5236\u7684\u56fe\u50cf\u4fdd\u5b58\u4e3a\u591a\u79cd\u683c\u5f0f\uff0c\u5982PNG\u3001JPEG\u3001PDF\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528matplotlib\u5e93\u7684savefig\u51fd\u6570<\/p>\n<\/p>\n<p><p>matplotlib\u5e93\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u7ed8\u56fe\u5e93\u4e4b\u4e00\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u7ed8\u56fe\u529f\u80fd\u548c\u5de5\u5177\u3002\u4f7f\u7528matplotlib\u5e93\u7684savefig\u51fd\u6570\u53ef\u4ee5\u5c06\u7ed8\u5236\u7684\u56fe\u50cf\u4fdd\u5b58\u4e3a\u591a\u79cd\u683c\u5f0f\uff0c\u5982PNG\u3001JPEG\u3001PDF\u7b49\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528matplotlib\u5e93\u4fdd\u5b58\u56fe\u50cf\u7684\u793a\u4f8b\uff1a<\/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\u56fe\u50cf<\/strong><\/h2>\n<p>plt.plot([1, 2, 3, 4], [1, 4, 9, 16])<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf\u4e3aPNG\u683c\u5f0f<\/strong><\/h2>\n<p>plt.savefig(&#39;image.png&#39;)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf\u4e3aJPEG\u683c\u5f0f<\/strong><\/h2>\n<p>plt.savefig(&#39;image.jpg&#39;)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf\u4e3aPDF\u683c\u5f0f<\/strong><\/h2>\n<p>plt.savefig(&#39;image.pdf&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528matplotlib\u5e93\u521b\u5efa\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u56fe\u50cf\uff0c\u7136\u540e\u4f7f\u7528savefig\u51fd\u6570\u5c06\u56fe\u50cf\u4fdd\u5b58\u4e3aPNG\u3001JPEG\u548cPDF\u683c\u5f0f\u3002\u6700\u540e\uff0c\u6211\u4eec\u4f7f\u7528show\u51fd\u6570\u663e\u793a\u56fe\u50cf\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528Pillow\u5e93\u7684save\u51fd\u6570<\/p>\n<\/p>\n<p><p>Pillow\u5e93\u662fPython\u4e2d\u53e6\u4e00\u4e2a\u5e38\u7528\u7684\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\u548c\u5de5\u5177\u3002\u4f7f\u7528Pillow\u5e93\u7684save\u51fd\u6570\u53ef\u4ee5\u5c06\u56fe\u50cf\u4fdd\u5b58\u4e3a\u591a\u79cd\u683c\u5f0f\uff0c\u5982PNG\u3001JPEG\u3001GIF\u7b49\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528Pillow\u5e93\u4fdd\u5b58\u56fe\u50cf\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image, ImageDraw<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\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\u4e00\u4e9b\u56fe\u5f62<\/strong><\/h2>\n<p>draw.rectangle([50, 50, 150, 150], outline=&#39;black&#39;, fill=&#39;blue&#39;)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf\u4e3aPNG\u683c\u5f0f<\/strong><\/h2>\n<p>image.save(&#39;image.png&#39;)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf\u4e3aJPEG\u683c\u5f0f<\/strong><\/h2>\n<p>image.save(&#39;image.jpg&#39;)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf\u4e3aGIF\u683c\u5f0f<\/strong><\/h2>\n<p>image.save(&#39;image.gif&#39;)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>image.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528Pillow\u5e93\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684\u56fe\u50cf\uff0c\u7136\u540e\u4f7f\u7528ImageDraw\u6a21\u5757\u7ed8\u5236\u4e86\u4e00\u4e9b\u56fe\u5f62\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528save\u51fd\u6570\u5c06\u56fe\u50cf\u4fdd\u5b58\u4e3aPNG\u3001JPEG\u548cGIF\u683c\u5f0f\u3002\u6700\u540e\uff0c\u6211\u4eec\u4f7f\u7528show\u51fd\u6570\u663e\u793a\u56fe\u50cf\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528OpenCV\u5e93\u7684imwrite\u51fd\u6570<\/p>\n<\/p>\n<p><p>OpenCV\u5e93\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\u548c\u5de5\u5177\u3002\u4f7f\u7528OpenCV\u5e93\u7684imwrite\u51fd\u6570\u53ef\u4ee5\u5c06\u56fe\u50cf\u4fdd\u5b58\u4e3a\u591a\u79cd\u683c\u5f0f\uff0c\u5982PNG\u3001JPEG\u3001BMP\u7b49\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528OpenCV\u5e93\u4fdd\u5b58\u56fe\u50cf\u7684\u793a\u4f8b\uff1a<\/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\u7b80\u5355\u7684\u56fe\u50cf<\/strong><\/h2>\n<p>image = np.zeros((200, 200, 3), dtype=np.uint8)<\/p>\n<p>cv2.rectangle(image, (50, 50), (150, 150), (255, 0, 0), -1)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf\u4e3aPNG\u683c\u5f0f<\/strong><\/h2>\n<p>cv2.imwrite(&#39;image.png&#39;, image)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf\u4e3aJPEG\u683c\u5f0f<\/strong><\/h2>\n<p>cv2.imwrite(&#39;image.jpg&#39;, image)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf\u4e3aBMP\u683c\u5f0f<\/strong><\/h2>\n<p>cv2.imwrite(&#39;image.bmp&#39;, image)<\/p>\n<h2><strong>\u663e\u793a\u56fe\u50cf<\/strong><\/h2>\n<p>cv2.imshow(&#39;image&#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>\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528OpenCV\u5e93\u521b\u5efa\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u56fe\u50cf\uff0c\u7136\u540e\u4f7f\u7528rectangle\u51fd\u6570\u7ed8\u5236\u4e86\u4e00\u4e2a\u77e9\u5f62\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528imwrite\u51fd\u6570\u5c06\u56fe\u50cf\u4fdd\u5b58\u4e3aPNG\u3001JPEG\u548cBMP\u683c\u5f0f\u3002\u6700\u540e\uff0c\u6211\u4eec\u4f7f\u7528imshow\u51fd\u6570\u663e\u793a\u56fe\u50cf\uff0c\u5e76\u4f7f\u7528waitKey\u548cdestroyAllWindows\u51fd\u6570\u7b49\u5f85\u7528\u6237\u8f93\u5165\u5e76\u5173\u95ed\u7a97\u53e3\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4fdd\u5b58\u56fe\u50cf\u65f6\u7684\u6ce8\u610f\u4e8b\u9879<\/p>\n<\/p>\n<p><p>\u5728\u4fdd\u5b58\u56fe\u50cf\u65f6\uff0c\u6709\u4e00\u4e9b\u6ce8\u610f\u4e8b\u9879\u9700\u8981\u7262\u8bb0\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6587\u4ef6\u683c\u5f0f<\/strong>\uff1a\u4e0d\u540c\u7684\u6587\u4ef6\u683c\u5f0f\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u5e94\u7528\u573a\u666f\u3002PNG\u683c\u5f0f\u9002\u7528\u4e8e\u4fdd\u5b58\u65e0\u635f\u538b\u7f29\u7684\u56fe\u50cf\uff0cJPEG\u683c\u5f0f\u9002\u7528\u4e8e\u4fdd\u5b58\u6709\u635f\u538b\u7f29\u7684\u56fe\u50cf\uff0cPDF\u683c\u5f0f\u9002\u7528\u4e8e\u4fdd\u5b58\u77e2\u91cf\u56fe\u50cf\u7b49\u3002\u5728\u9009\u62e9\u6587\u4ef6\u683c\u5f0f\u65f6\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u9009\u62e9\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u56fe\u50cf\u8d28\u91cf<\/strong>\uff1a\u5728\u4fdd\u5b58\u6709\u635f\u538b\u7f29\u7684\u56fe\u50cf\uff08\u5982JPEG\u683c\u5f0f\uff09\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u56fe\u50cf\u8d28\u91cf\u53c2\u6570\u6765\u63a7\u5236\u56fe\u50cf\u7684\u538b\u7f29\u6bd4\u548c\u8d28\u91cf\u3002\u5728\u4f7f\u7528matplotlib\u5e93\u4fdd\u5b58JPEG\u683c\u5f0f\u7684\u56fe\u50cf\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>quality<\/code>\u53c2\u6570\u6765\u8bbe\u7f6e\u56fe\u50cf\u8d28\u91cf\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">plt.savefig(&#39;image.jpg&#39;, quality=95)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>DPI\u8bbe\u7f6e<\/strong>\uff1aDPI\uff08\u6bcf\u82f1\u5bf8\u70b9\u6570\uff09\u662f\u8861\u91cf\u56fe\u50cf\u5206\u8fa8\u7387\u7684\u4e00\u4e2a\u91cd\u8981\u53c2\u6570\u3002\u5728\u4fdd\u5b58\u56fe\u50cf\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6eDPI\u53c2\u6570\u6765\u63a7\u5236\u56fe\u50cf\u7684\u5206\u8fa8\u7387\u3002\u5728\u4f7f\u7528matplotlib\u5e93\u4fdd\u5b58\u56fe\u50cf\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>dpi<\/code>\u53c2\u6570\u6765\u8bbe\u7f6eDPI\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">plt.savefig(&#39;image.png&#39;, dpi=300)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li><strong>\u900f\u660e\u5ea6<\/strong>\uff1a\u5728\u4fdd\u5b58\u5e26\u6709\u900f\u660e\u80cc\u666f\u7684\u56fe\u50cf\uff08\u5982PNG\u683c\u5f0f\uff09\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u900f\u660e\u5ea6\u53c2\u6570\u6765\u63a7\u5236\u56fe\u50cf\u7684\u900f\u660e\u5ea6\u3002\u5728\u4f7f\u7528matplotlib\u5e93\u4fdd\u5b58\u56fe\u50cf\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>transparent<\/code>\u53c2\u6570\u6765\u8bbe\u7f6e\u900f\u660e\u5ea6\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">plt.savefig(&#39;image.png&#39;, transparent=True)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u4fdd\u5b58Python\u753b\u7684\u56fe\u7247\u683c\u5f0f\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u5176\u4e2d\u4f7f\u7528matplotlib\u5e93\u7684savefig\u51fd\u6570\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528Pillow\u5e93\u7684save\u51fd\u6570\u548cOpenCV\u5e93\u7684imwrite\u51fd\u6570\u6765\u4fdd\u5b58\u56fe\u50cf\u3002\u5728\u4fdd\u5b58\u56fe\u50cf\u65f6\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u6587\u4ef6\u683c\u5f0f\uff0c\u5e76\u6ce8\u610f\u56fe\u50cf\u8d28\u91cf\u3001DPI\u8bbe\u7f6e\u548c\u900f\u660e\u5ea6\u7b49\u53c2\u6570\u7684\u8bbe\u7f6e\u3002\u901a\u8fc7\u638c\u63e1\u8fd9\u4e9b\u65b9\u6cd5\u548c\u6280\u5de7\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u4fdd\u5b58\u548c\u5206\u4eab\u7ed8\u5236\u7684\u56fe\u50cf\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u9009\u62e9\u9002\u5f53\u7684\u56fe\u7247\u683c\u5f0f\u8fdb\u884c\u4fdd\u5b58\uff1f<\/strong><br \/>\u5728Python\u4e2d\u4fdd\u5b58\u56fe\u7247\u65f6\uff0c\u53ef\u4ee5\u9009\u62e9\u591a\u79cd\u683c\u5f0f\uff0c\u4f8b\u5982PNG\u3001JPEG\u3001BMP\u7b49\u3002\u9009\u62e9\u683c\u5f0f\u5e94\u57fa\u4e8e\u4f7f\u7528\u9700\u6c42\uff0c\u4f8b\u5982PNG\u652f\u6301\u900f\u660e\u80cc\u666f\uff0c\u9002\u5408\u9700\u8981\u9ad8\u8d28\u91cf\u56fe\u50cf\u7684\u573a\u5408\uff1b\u800cJPEG\u5219\u9002\u5408\u4fdd\u5b58\u7167\u7247\uff0c\u6587\u4ef6\u4f53\u79ef\u5c0f\u4f46\u53ef\u80fd\u4f1a\u635f\u5931\u4e00\u4e9b\u56fe\u50cf\u8d28\u91cf\u3002\u4f7f\u7528Python\u7684PIL\u5e93\u6216Matplotlib\u5e93\u90fd\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u4fdd\u5b58\u4e0d\u540c\u683c\u5f0f\u7684\u56fe\u7247\u3002<\/p>\n<p><strong>\u4fdd\u5b58\u56fe\u7247\u65f6\uff0c\u5982\u4f55\u8bbe\u7f6e\u56fe\u7247\u7684\u5206\u8fa8\u7387\u548c\u8d28\u91cf\uff1f<\/strong><br \/>\u5728\u4fdd\u5b58\u56fe\u7247\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u53c2\u6570\u8c03\u6574\u56fe\u7247\u7684\u5206\u8fa8\u7387\u548c\u8d28\u91cf\u3002\u4f8b\u5982\uff0c\u4f7f\u7528PIL\u5e93\u7684<code>save()<\/code>\u65b9\u6cd5\u65f6\uff0c\u53ef\u4ee5\u6307\u5b9a<code>quality<\/code>\u53c2\u6570\u6765\u63a7\u5236JPEG\u683c\u5f0f\u7684\u8d28\u91cf\uff08\u8303\u56f4\u4e3a1\u5230100\uff09\uff0c\u540c\u65f6\u5728\u4fdd\u5b58\u65f6\u53ef\u4ee5\u8bbe\u7f6e<code>dpi<\/code>\u53c2\u6570\u6765\u5b9a\u4e49\u56fe\u7247\u7684\u5206\u8fa8\u7387\uff0c\u4ee5\u4fbf\u5728\u6253\u5370\u6216\u5c55\u793a\u65f6\u80fd\u4fdd\u6301\u6e05\u6670\u5ea6\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u5728\u4fdd\u5b58\u56fe\u7247\u65f6\u51fa\u73b0\u7684\u9519\u8bef\u6216\u5f02\u5e38\uff1f<\/strong><br \/>\u5728\u4fdd\u5b58\u56fe\u7247\u65f6\uff0c\u5e38\u89c1\u7684\u9519\u8bef\u5305\u62ec\u6587\u4ef6\u8def\u5f84\u4e0d\u5b58\u5728\u3001\u6743\u9650\u4e0d\u8db3\u7b49\u3002\u4e3a\u4e86\u5904\u7406\u8fd9\u4e9b\u95ee\u9898\uff0c\u53ef\u4ee5\u4f7f\u7528try-except\u7ed3\u6784\u6765\u6355\u83b7\u5f02\u5e38\uff0c\u5e76\u63d0\u4f9b\u7528\u6237\u53cb\u597d\u7684\u63d0\u793a\u4fe1\u606f\u3002\u786e\u4fdd\u5728\u4fdd\u5b58\u4e4b\u524d\uff0c\u6587\u4ef6\u8def\u5f84\u662f\u6709\u6548\u7684\uff0c\u5e76\u4e14\u8fd0\u884c\u7a0b\u5e8f\u7684\u7528\u6237\u6709\u8db3\u591f\u7684\u6743\u9650\u5728\u8be5\u8def\u5f84\u4e0b\u521b\u5efa\u6587\u4ef6\uff0c\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u907f\u514d\u5927\u591a\u6570\u4fdd\u5b58\u5931\u8d25\u7684\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u4fdd\u5b58Python\u753b\u7684\u56fe\u7247\u683c\u5f0f\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a\u4f7f\u7528matplotlib\u5e93\u7684savefig\u51fd\u6570\u3001\u4f7f\u7528Pi [&hellip;]","protected":false},"author":3,"featured_media":1038316,"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\/1038302"}],"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=1038302"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1038302\/revisions"}],"predecessor-version":[{"id":1038323,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1038302\/revisions\/1038323"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1038316"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1038302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1038302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1038302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}