{"id":2210,"date":"2024-07-11T12:54:43","date_gmt":"2024-07-11T03:54:43","guid":{"rendered":"https:\/\/secondlife.lol\/?p=2210"},"modified":"2024-07-21T16:23:54","modified_gmt":"2024-07-21T07:23:54","slug":"python-trigonometric-function-graphs","status":"publish","type":"post","link":"https:\/\/secondlife.lol\/zh\/python-trigonometric-function-graphs\/","title":{"rendered":"\u7ed8\u5236\u4e09\u89d2\u51fd\u6570\u56fe\uff1a\u5982\u4f55\u5c06\u6570\u5b66\u4e4b\u7f8e\u53ef\u89c6\u5316\uff08\u4ee5 Python \u4e3a\u7279\u8272\uff09"},"content":{"rendered":"<p class=\"wp-block-paragraph\">\u5728\u6570\u5b66\u8bfe\u4e0a\u5b66\u4e60\u4e09\u89d2\u51fd\u6570\u65f6\uff0c\u4f60\u6709\u6ca1\u6709\u5c1d\u8bd5\u8fc7\u624b\u7ed8\u56fe\u5f62\uff1f\u4f60\u53ef\u4ee5\u7c97\u7565\u5730\u753b\u51fa\u6765\uff0c\u4f46\u8981\u753b\u5f97\u6f02\u4eae\u5374\u5e76\u4e0d\u5bb9\u6613\uff0c\u5bf9\u5427\uff1f \u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u7528 Python \u6765\u770b\u770b\u5b83\u4eec\u5230\u5e95\u662f\u4ec0\u4e48\u6837\u5b50\u7684\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u672c\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u5411\u60a8\u5c55\u793a\u5982\u4f55\u4f7f\u7528 Python \u8f7b\u677e\u3001\u51c6\u786e\u5730\u7ed8\u5236 sin\u3001cos \u548c tan \u51fd\u6570\u7684\u56fe\u5f62\u3002\u6211\u4eec\u5c06\u63d0\u4f9b\u7f16\u7801\u521d\u5b66\u8005\u4e5f\u80fd\u9075\u5faa\u7684\u5206\u6b65\u6307\u5357\uff0c\u4ee5\u53ca\u81ea\u5b9a\u4e49\u56fe\u5f62\u7684\u6280\u5de7\u3002\u638c\u63e1\u8fd9\u9879\u6280\u80fd\u5c06\u6709\u52a9\u4e8e\u4f60\u5b8c\u6210\u6570\u5b66\u4f5c\u4e1a\u548c\u6570\u636e\u53ef\u89c6\u5316\u9879\u76ee\u3002<\/p>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{color:var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{color:var(--global-palette2, #2B6CB0);font-size:28px;font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list{color:var(--global-palette1, #3182CE);line-height:2em;font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list .kb-table-of-contents__entry:hover{color:var(--global-palette6, #718096);}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}@media all and (max-width: 767px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}<\/style>\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5\u6240\u9700\u7684\u7a0b\u5e8f\u5e93<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5\u5fc5\u8981\u7684\u5e93\u3002\u5728\u7ec8\u7aef\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u54e6\uff0c\u5982\u679c\u4f60\u4e0d\u77e5\u9053\u5982\u4f55\u4f7f\u7528 VS \u4ee3\u7801\u6765\u8fd0\u884c Python \u6e90\u4ee3\u7801\u3001 <a href=\"https:\/\/secondlife.lol\/zh\/vs-code-install\/\" data-type=\"post\" data-id=\"372\">\u5b89\u88c5 VS CODE - Windows<\/a>  \u8bf7\u67e5\u770b\u5e16\u5b50\u5e76\u8ddf\u5e16\u3002 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install numpy matplotlib<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7f16\u5199\u57fa\u672c\u4ee3\u7801<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0b\u662f\u7ed8\u5236 sin\u3001cos \u548c tan \u51fd\u6570\u56fe\u5f62\u7684\u57fa\u672c\u4ee3\u7801\u3002 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5bfc\u5165 numpy \u548c matplotlib \u5e93\u3002\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# \u751f\u6210 1000 \u4e2a\u4ece -2\u03c0 \u5230 2\u03c0 \u95f4\u9694\u5747\u5300\u7684 x \u503c\u3002\nx = np.linspace(-2 * np.pi, 2 * np.pi, 1000)\n\n# \u6839\u636e\u751f\u6210\u7684 x \u503c\u8ba1\u7b97 sin\u3001cos \u548c tan \u51fd\u6570\u503c\u3002\ny_sin = np.sin(x)\ny_cos = np.cos(x)\ny_tan = np.tan(x)\n\n1\u521b\u5efa\u4e00\u4e2a Figure \u5bf9\u8c61\u6765\u7ed8\u5236 TP5T \u56fe\u5f62\uff0c\u5e76\u8bbe\u7f6e\u5176\u5927\u5c0f\u3002\nplt.figure(figsize=(12, 8))\n\n\u7ed8\u5236 # \u4e09\u89d2\u51fd\u6570\u56fe\u3002\nplt.plot(x, y_sin, label='sin(x)')\nplt.plot(x, y_cos, label='cos(x)')\nplt.plot(x, y_tan, label='tan(x)')\nplt.legend()\nplt.show()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u6211\u4eec\u7528\u4e0a\u9762\u7684\u4ee3\u7801\u7ed8\u5236\u56fe\u5f62\uff0c\u7ed3\u679c\u5982\u4e0b\u3002\u6bcf\u4e2a\u4e09\u89d2\u51fd\u6570\u90fd\u6ca1\u6709\u6b63\u786e\u6807\u8bc6\uff0cX \u8f74\u4e0a\u7684\u503c\u4e5f\u4e0d\u662f\u901a\u5e38\u6240\u89c1\u7684\uff08\u5982 \u03c0\uff09\u3002<\/p>\n\n\n<style>.kb-image2210_352059-e2 .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2210_352059-e2 img.kb-img, .kb-image2210_352059-e2 .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2210_352059-e2\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image.jpg\" class=\"kb-advanced-image-link\"><img decoding=\"async\" width=\"600\" height=\"405\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-600x405.jpg\" alt=\"\uc0bc\uac01\ud568\uc218 \uadf8\ub798\ud504 \uadf8\ub9ac\uae30\" class=\"kb-img wp-image-2215\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-600x405.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-300x203.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-768x519.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image.jpg 1024w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u81ea\u5b9a\u4e49\u56fe\u8868<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ba9\u6211\u4eec\u4e3a\u57fa\u672c\u56fe\u5f62\u6dfb\u52a0\u4e00\u4e9b\u5143\u7d20\uff0c\u4f7f\u5b83\u770b\u8d77\u6765\u66f4\u7f8e\u89c2\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5bfc\u5165 numpy \u548c matplotlib \u5e93\u3002\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# \u751f\u6210 1000 \u4e2a\u4ece -2\u03c0 \u5230 2\u03c0 \u95f4\u9694\u5747\u5300\u7684 x \u503c\u3002\nx = np.linspace(-2 * np.pi, 2 * np.pi, 1000)\n\n# \u6839\u636e\u751f\u6210\u7684 x \u503c\u8ba1\u7b97 sin\u3001cos \u548c tan \u51fd\u6570\u503c\u3002\ny_sin = np.sin(x)\ny_cos = np.cos(x)\ny_tan = np.tan(x)\n\n# \u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\uff0c\u4ee5 \u03c0 \u4e3a\u589e\u91cf\u5728 x \u8f74\u4e0a\u663e\u793a\u523b\u5ea6\u7ebf\u3002\ndef set_pi_ticks(ax)\uff1a\n    # \u4ee5 \u03c0\/2 \u4e3a\u95f4\u9694\u8bbe\u7f6e\u4ece -2\u03c0 \u5230 2\u03c0 \u7684\u523b\u5ea6\u7ebf\u4f4d\u7f6e\u3002\n    ax.set_xticks(np.array(-2*np.pi, 2.1*np.pi, np.pi\/2))\n    # \u8bbe\u7f6e\u6bcf\u4e2a\u523b\u5ea6\u5bf9\u5e94\u7684\u6807\u7b7e\u3002\u7528 LaTeX \u683c\u5f0f\u8868\u793a \u03c0\u3002\n    ax.set_xticklabels([r'$-2\\pi$', r'$-3\\pi\/2$', r'$-\\pi$', r'$-\\pi\/2$', '0'\u3001\n                        r'$\\pi\/2$', r'$\\pi$', r'$3\\pi\/2$', r'$2\\pi$'])\n\n\u8bbe\u7f6e # \u56fe\u5f62\u7684\u5927\u5c0f\uff08\u5bbd 12 \u82f1\u5bf8\uff0c\u9ad8 8 \u82f1\u5bf8\uff09\u3002\nplt.figure(figsize=(12, 8))\n\n# \u83b7\u53d6\u5f53\u524d\u8f74\u5bf9\u8c61\u3002\nax = plt.gca()\n\n# \u7ed8\u5236 sin\u3001cos \u548c tan \u51fd\u6570\u7684\u56fe\u5f62\u3002\u6bcf\u4e2a\u51fd\u6570\u90fd\u7528\u4e0d\u540c\u7684\u989c\u8272\u7ed8\u5236\uff0c\u60a8\u8fd8\u53ef\u4ee5\u6307\u5b9a\u56fe\u4f8b\u4e2d\u7684\u540d\u79f0\u3002\nplt.plot(x, y_sin, label='sin(x)')\nplt.plot(x, y_cos, label='cos(x)')\nplt.plot(x, y_tan, label='tan(x)')\n\n\u4e3a # \u56fe\u5f62\u8bbe\u7f6e\u6807\u9898\u3002\nplt.title('Trigonometric Functions')\n\n# \u4e3a x \u8f74\u548c y \u8f74\u8bbe\u7f6e\u6807\u7b7e\u3002\nplt.xlabel('x')\nplt.ylabel('y')\n\n# \u4ee5\u9ed1\u8272\u5b9e\u7ebf\u7ed8\u5236 x \u8f74\uff08y=0\uff09\u548c y \u8f74\uff08x=0\uff09\u3002\nplt.axhline(0, color='black', linewidth=0.5)\nplt.axvline(0, color='black', linewidth=0.5)\n\n\u4e3a # \u56fe\u5f62\u6dfb\u52a0\u7f51\u683c\u7ebf\u3002\nplt.grid(True)\n\n\u663e\u793a # \u56fe\u4f8b\u3002\nplt.legend()\n\n# \u5728 x \u8f74\u4e0a\u663e\u793a\u4ee5 \u03c0 \u4e3a\u5355\u4f4d\u7684\u523b\u5ea6\u3002\nset_pi_ticks(ax)\n\n\u5c06 # y \u8f74\u7684\u8303\u56f4\u9650\u5236\u5728 -3 \u81f3 3 \u4e4b\u95f4\u3002\nplt.ylim(-3, 3)\n\n# \u81ea\u52a8\u8c03\u6574\u56fe\u5f62\u5e03\u5c40\u3002\nplt.tight_layout()\n\n\u5728\u5c4f\u5e55\u4e0a\u663e\u793a # \u56fe\u5f62\u3002\nplt.show()<\/code><\/pre>\n\n\n<style>.kb-image2210_12c763-4c .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2210_12c763-4c img.kb-img, .kb-image2210_12c763-4c .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2210_12c763-4c\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-1.jpg\" class=\"kb-advanced-image-link\"><img decoding=\"async\" width=\"600\" height=\"396\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-1-600x396.jpg\" alt=\"\uc0bc\uac01\ud568\uc218 \uadf8\ub798\ud504 \uadf8\ub9ac\uae30\" class=\"kb-img wp-image-2216\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-1-600x396.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-1-300x198.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-1-768x507.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-1.jpg 1192w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u7ed8\u5236\u5355\u4e2a\u56fe\u8868<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u5728\u5355\u72ec\u7684\u5b50\u56fe\u4e2d\u7ed8\u5236\u6bcf\u4e2a\u51fd\u6570\uff0c\u60a8\u53ef\u4ee5\u770b\u5230\u66f4\u591a\u7ec6\u8282\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5bfc\u5165 numpy \u548c matplotlib \u5e93\u3002\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# \u751f\u6210 1000 \u4e2a\u4ece -2\u03c0 \u5230 2\u03c0 \u95f4\u9694\u5747\u5300\u7684 x \u503c\u3002\nx = np.linspace(-2 * np.pi, 2 * np.pi, 1000)\n\n# \u6839\u636e\u751f\u6210\u7684 x \u503c\u8ba1\u7b97 sin\u3001cos \u548c tan \u51fd\u6570\u503c\u3002\ny_sin = np.sin(x)\ny_cos = np.cos(x)\ny_tan = np.tan(x)\n\n# \u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\uff0c\u4ee5 \u03c0 \u4e3a\u589e\u91cf\u5728 x \u8f74\u4e0a\u663e\u793a\u523b\u5ea6\u7ebf\u3002\ndef set_pi_ticks(ax)\uff1a\n    # \u4ee5 \u03c0\/2 \u4e3a\u95f4\u9694\u8bbe\u7f6e\u4ece -2\u03c0 \u5230 2\u03c0 \u7684\u523b\u5ea6\u7ebf\u4f4d\u7f6e\u3002\n    ax.set_xticks(np.array(-2*np.pi, 2.1*np.pi, np.pi\/2))\n    # \u8bbe\u7f6e\u6bcf\u4e2a\u523b\u5ea6\u5bf9\u5e94\u7684\u6807\u7b7e\u3002\u7528 LaTeX \u683c\u5f0f\u8868\u793a \u03c0\u3002\n    ax.set_xticklabels([r'$-2\\pi$', r'$-3\\pi\/2$', r'$-\\pi$', r'$-\\pi\/2$', '0'\u3001\n                        r'$\\pi\/2$', r'$\\pi$', r'$3\\pi\/2$', r'$2\\pi$'])\n\n# \u8bbe\u7f6e\u6574\u4e2a\u56fe\u8868\u7684\u5927\u5c0f\uff08\u5bbd 12 \u82f1\u5bf8\uff0c\u9ad8 12 \u82f1\u5bf8\uff09\u3002\nplt.figure(figsize=(12, 12))\n\n# \u7ed8\u5236 sin \u51fd\u6570\u56fe\uff08\u7b2c\u4e00\u4e2a\u5b50\u56fe\uff09\nax1 = plt.subplot(3, 1, 1) # \u5728\u7b2c 3 \u884c\u7b2c 1 \u5217\u7f51\u683c\u4e2d\u7684\u7b2c\u4e00\u4e2a\u4f4d\u7f6e\u521b\u5efa\u5b50\u56fe\u3002\nplt.plot(x, y_sin, label='sin(x)')  # \u7ed8\u5236 sin \u51fd\u6570\u7684\u56fe\u5f62\u3002\nplt.title('sin \u51fd\u6570') # \u8bbe\u7f6e\u5b50\u7ed8\u56fe\u7684\u6807\u9898\u3002\nplt.ylabel('sin(x)')  \u8bbe\u7f6e # y \u8f74\u6807\u7b7e\u3002\nplt.grid(True) # \u6dfb\u52a0\u7f51\u683c\u7ebf\u3002\nplt.legend() # \u663e\u793a\u56fe\u4f8b\u3002\nset_pi_ticks(ax1) # \u5728 x \u8f74\u4e0a\u663e\u793a\u4ee5 \u03c0 \u4e3a\u5355\u4f4d\u7684\u523b\u5ea6\u3002\n\n# \u7ed8\u5236 cos \u51fd\u6570\u56fe\uff08\u7b2c\u4e8c\u4e2a\u5b50\u56fe\uff09\nax2 = plt.subplot(3, 1, 2) # \u5728\u7b2c 3 \u884c\u7b2c 1 \u5217\u7f51\u683c\u7684\u7b2c\u4e8c\u4e2a\u4f4d\u7f6e\u521b\u5efa\u5b50\u7f51\u683c\u3002\nplt.plot(x, y_cos, label='cos(x)', color='orange') # \u7528\u6a59\u8272\u7ed8\u5236 cos \u51fd\u6570\u7684\u56fe\u5f62\u3002\nplt.title('cos \u51fd\u6570')\nplt.ylabel('cos(x)')\nplt.grid(True)\nplt.legend()\nset_pi_ticks(ax2)\n\n# tan \u51fd\u6570\u7684\u56fe\u5f62\uff08\u7b2c\u4e09\u4e2a\u5b50\u7ed8\u56fe\uff09\nax3 = plt.subplot(3, 1, 3) # \u5728\u7b2c 3 \u884c\u7b2c 1 \u5217\u7f51\u683c\u7684\u7b2c\u4e09\u4e2a\u4f4d\u7f6e\u521b\u5efa\u5b50\u56fe\u3002\nplt.plot(x, y_tan, label='tan(x)', color='green') # \u7528\u7eff\u8272\u7ed8\u5236 tan \u51fd\u6570\u7684\u56fe\u5f62\u3002\nplt.title('tan \u51fd\u6570')\nplt.xlabel('x') # \u8bbe\u7f6e x \u8f74\u6807\u7b7e\uff08\u4ec5\u5728\u5e95\u90e8\u5b50\u56fe\u4e2d\u53ef\u89c1\uff09\u3002\nplt.ylabel('tan(x)')\nplt.ylim(-10, 10) # \u5c06 y \u8f74\u7684\u8303\u56f4\u9650\u5236\u5728 -10 \u81f3 10 \u4e4b\u95f4\uff08\u8003\u8651\u5230 tan \u51fd\u6570\u7684\u53d1\u6563\u6027\uff09\u3002\nplt.grid(True)\nplt.legend()\nset_pi_ticks(ax3)\n\n\u81ea\u52a8\u8c03\u6574 # \u5b50\u56fe\u4e4b\u95f4\u7684\u95f4\u8ddd\u3002\nplt.tight_layout()\n\n\u5728\u5c4f\u5e55\u4e0a\u663e\u793a # \u56fe\u5f62\u3002\nplt.show()\n<\/code><\/pre>\n\n\n<style>.kb-image2210_202f8d-92 .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2210_202f8d-92 img.kb-img, .kb-image2210_202f8d-92 .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2210_202f8d-92\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-2.jpg\" class=\"kb-advanced-image-link\"><img decoding=\"async\" width=\"600\" height=\"505\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-2-600x505.jpg\" alt=\"\uc0bc\uac01\ud568\uc218 \uadf8\ub798\ud504 \uadf8\ub9ac\uae30\" class=\"kb-img wp-image-2217\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-2-600x505.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-2-300x252.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-2-768x646.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-2.jpg 1190w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u7ec4\u7ec7\u8d77\u6765<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u672c\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3\u4e86\u5982\u4f55\u4f7f\u7528 Python \u548c Matplotlib \u8f7b\u677e\u5730\u5c06\u590d\u6742\u7684\u6570\u5b66\u51fd\u6570\u53ef\u89c6\u5316\u3002 \u5e94\u7528\u8fd9\u4e9b\u6280\u672f\u5c06\u66f4\u5bb9\u6613\u7406\u89e3\u548c\u89e3\u91ca\u5404\u79cd\u6570\u5b66\u6982\u5ff5\u3002 <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c1d\u8bd5\u7ed8\u5236\u4e00\u4e9b\u6269\u5c55\u51fd\u6570\u7684\u56fe\u5f62\uff0c\u5982 sin(2x)\u3002\u4f60\u4f1a\u5bf9\u8fd9\u4e9b\u56fe\u5f62\u6709\u66f4\u597d\u7684\u611f\u89c9\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u5728\u8111\u6d77\u4e2d\u601d\u8003\uff01\u5feb\u6765\u8bd5\u8bd5\u5427\uff01<\/p>","protected":false},"excerpt":{"rendered":"<p>\u5728\u6570\u5b66\u8bfe\u4e0a\u5b66\u4e60\u4e09\u89d2\u51fd\u6570\u65f6\uff0c\u60a8\u662f\u5426\u66fe\u624b\u7ed8\u8fc7\u56fe\u5f62\uff1f\u5927\u7ea6...<\/p>","protected":false},"author":3,"featured_media":2251,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[3],"tags":[162,34,164,165,163],"class_list":["post-2210","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-coding","tag-matplotlib","tag-python","tag-164","tag-165","tag-163"],"taxonomy_info":{"category":[{"value":3,"label":"\ud30c\uc774\uc36c(Python)"}],"post_tag":[{"value":162,"label":"Matplotlib"},{"value":34,"label":"python"},{"value":164,"label":"\ub370\uc774\ud130 \uc2dc\uac01\ud654"},{"value":165,"label":"\uc0bc\uac01\ud568\uc218"},{"value":163,"label":"\uc218\ud559"}]},"featured_image_src_large":["https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/\uc0bc\uac01\ud568\uc218-\uadf8\ub798\ud504-\uadf8\ub9ac\uae30-\uc378\ub124\uc77c-600x600.jpg",600,600,true],"author_info":{"display_name":"TERE","author_link":"https:\/\/secondlife.lol\/zh\/author\/tere\/"},"comment_info":0,"category_info":[{"term_id":3,"name":"\ud30c\uc774\uc36c(Python)","slug":"python-coding","term_group":0,"term_taxonomy_id":3,"taxonomy":"category","description":"","parent":20,"count":119,"filter":"raw","cat_ID":3,"category_count":119,"category_description":"","cat_name":"\ud30c\uc774\uc36c(Python)","category_nicename":"python-coding","category_parent":20}],"tag_info":[{"term_id":162,"name":"Matplotlib","slug":"matplotlib","term_group":0,"term_taxonomy_id":162,"taxonomy":"post_tag","description":"","parent":0,"count":19,"filter":"raw"},{"term_id":34,"name":"python","slug":"python","term_group":0,"term_taxonomy_id":34,"taxonomy":"post_tag","description":"","parent":0,"count":22,"filter":"raw"},{"term_id":164,"name":"\ub370\uc774\ud130 \uc2dc\uac01\ud654","slug":"%eb%8d%b0%ec%9d%b4%ed%84%b0-%ec%8b%9c%ea%b0%81%ed%99%94","term_group":0,"term_taxonomy_id":164,"taxonomy":"post_tag","description":"","parent":0,"count":52,"filter":"raw"},{"term_id":165,"name":"\uc0bc\uac01\ud568\uc218","slug":"%ec%82%bc%ea%b0%81%ed%95%a8%ec%88%98","term_group":0,"term_taxonomy_id":165,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":163,"name":"\uc218\ud559","slug":"%ec%88%98%ed%95%99","term_group":0,"term_taxonomy_id":163,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/posts\/2210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/comments?post=2210"}],"version-history":[{"count":6,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/posts\/2210\/revisions"}],"predecessor-version":[{"id":2252,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/posts\/2210\/revisions\/2252"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/media\/2251"}],"wp:attachment":[{"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/media?parent=2210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/categories?post=2210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/tags?post=2210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}