{"id":51,"date":"2019-05-09T21:24:24","date_gmt":"2019-05-09T13:24:24","guid":{"rendered":"https:\/\/kanghaov.com\/?p=51"},"modified":"2024-11-26T15:51:18","modified_gmt":"2024-11-26T07:51:18","slug":"%e4%bd%bf%e7%94%a8-matplotlib-%e7%bb%98%e5%88%b6-2d-%e5%92%8c-3d-%e5%9b%be%e5%bd%a2","status":"publish","type":"post","link":"https:\/\/nemo.cool\/51.html","title":{"rendered":"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62"},"content":{"rendered":"<h1>\u4ecb\u7ecd<\/h1>\n<p>Matplotlib \u662f\u652f\u6301 Python \u8bed\u8a00\u7684\u5f00\u6e90\u7ed8\u56fe\u5e93\uff0c\u56e0\u4e3a\u5176\u652f\u6301\u4e30\u5bcc\u7684\u7ed8\u56fe\u7c7b\u578b\u3001\u7b80\u5355\u7684\u7ed8\u56fe\u65b9\u5f0f\u4ee5\u53ca\u5b8c\u5584\u7684\u63a5\u53e3\u6587\u6863\uff0c\u6df1\u53d7 Python \u5de5\u7a0b\u5e08\u3001\u79d1\u7814\u5b66\u8005\u3001\u6570\u636e\u5de5\u7a0b\u5e08\u7b49\u5404\u7c7b\u4eba\u58eb\u7684\u559c\u6b22\u3002<\/p>\n<h1>\u77e5\u8bc6\u70b9<\/h1>\n<ul>\n<li>\u56fe\u540d\u79f0\u3001\u5750\u6807\u8f74\u540d\u79f0\u3001\u56fe\u4f8b<\/li>\n<li>\u7ebf\u578b\u3001\u989c\u8272\u3001\u900f\u660e\u5ea6<\/li>\n<li>\u753b\u5e03\u7f51\u683c\u3001\u5750\u6807\u8f74\u8303\u56f4<\/li>\n<li>\u5176\u4ed6 2D \u56fe\u5f62<\/li>\n<li>3D \u56fe\u5f62<\/li>\n<\/ul>\n<h1>Matplotlib \u9762\u5411\u5bf9\u8c61 API<\/h1>\n<p>\u5bfc\u5165\u6a21\u5757\uff1a<\/p>\n<pre><code class=\"\">from matplotlib import pyplot as plt\n<\/code><\/pre>\n<p>\u4f7f\u7528 NumPy \u751f\u6210\u968f\u673a\u6570\u636e\uff1a<\/p>\n<pre><code class=\"\">\"\"\"\u4f7f\u7528 NumPy \u751f\u6210\u968f\u673a\u6570\u636e\n\"\"\"\nimport numpy as np\n\nx = np.linspace(0, 10, 20)\ny = x * x + 2\n<\/code><\/pre>\n<h2>1.\u7ed8\u56fe\uff1a<\/h2>\n<pre><code class=\"\">fig = plt.figure() # \u65b0\u5efa\u56fe\u5f62\u5bf9\u8c61\n\naxes = fig.add_axes([0.5, 0.1, 0.8, 0.8]) \n# \u63a7\u5236\u753b\u5e03\u7684\u5de6, \u4e0b, \u5bbd\u5ea6, \u9ad8\u5ea6 (\u4ece 0 \u5230 1)\n\naxes.plot(x, y, 'r')\n<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20002.jpg\" alt=\"\" \/><\/p>\n<p><font color='brown'><strong>\u91cd\u70b9\uff1a<\/strong><\/font><br \/>\n\u4e0a\u9762\u7684\u7ed8\u56fe\u4ee3\u7801\u4e2d\uff0c\u4f60\u53ef\u80fd\u4f1a\u5bf9 <code>figure<\/code> \u548c <code>axes<\/code> \u4ea7\u751f\u7591\u95ee\u3002Matplotlib \u7684 API \u8bbe\u8ba1\u7684\u975e\u5e38\u7b26\u5408\u5e38\u7406\uff0c\u5728\u8fd9\u91cc\uff0c<code>figure<\/code> \u76f8\u5f53\u4e8e\u7ed8\u753b\u7528\u7684\u753b\u677f\uff0c\u800c <code>axes<\/code> \u5219\u76f8\u5f53\u4e8e\u94fa\u5728\u753b\u677f\u4e0a\u7684\u753b\u5e03\u3002\u6211\u4eec\u5c06\u56fe\u50cf\u7ed8\u5236\u5728\u753b\u5e03\u4e0a\uff0c\u4e8e\u662f\u5c31\u6709\u4e86 <code>plot<\/code>\uff0c<code>set_xlabel<\/code> \u7b49\u64cd\u4f5c\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20003.jpg\" alt=\"\" \/><\/p>\n<h3>\u65b9\u6cd5 1\uff1aplt.subplots\u7ed8\u5236\u5b50\u56fe<\/h3>\n<pre><code class=\"\">fig, axes = plt.subplots(nrows=1, ncols=2)  # \u5b50\u56fe\u4e3a 1 \u884c\uff0c2 \u5217\n\nfor ax in axes:\n    ax.plot(x, y, 'r')\n<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20004.jpg\" alt=\"\" \/><\/p>\n<p>\u8fd8\u80fd\u5c06\u4e00\u5f20\u56fe\u7ed8\u5236\u5728\u53e6\u4e00\u5f20\u56fe\u7684\u5185\u90e8<\/p>\n<pre><code class=\"\">fig = plt.figure() # \u65b0\u5efa\u753b\u677f\n\naxes1 = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # \u5927\u753b\u5e03\naxes2 = fig.add_axes([0.2, 0.5, 0.4, 0.3]) # \u5c0f\u753b\u5e03\n\n# \u5927\u753b\u5e03\naxes1.plot(x, y, 'r')\n\n# \u5c0f\u753b\u5e03\naxes2.plot(y, x, 'g')\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20005.jpg\" alt=\"\" \/><\/p>\n<p><font color='brown'><strong>Tips\uff1a<\/strong><\/font><br \/>\n\u4e0a\u9762\u7684\u7ed8\u56fe\u4ee3\u7801\u4e2d\uff0c\u4f60\u53ef\u80fd\u5b66\u4f1a\u4e86\u4f7f\u7528 <code>add_axes()<\/code> \u65b9\u6cd5\u5411\u6211\u4eec\u8bbe\u7f6e\u7684\u753b\u677f <code>figure<\/code> \u4e2d\u6dfb\u52a0\u753b\u5e03 <code>axes<\/code>\u3002\u5728 Matplotlib \u4e2d\uff0c\u8fd8\u6709\u4e00\u79cd\u6dfb\u52a0\u753b\u5e03\u7684\u65b9\u5f0f\uff0c\u90a3\u5c31\u662f<code>plt.subplots()<\/code>\uff0c<strong>\u5b83\u548c <code>axes<\/code> \u90fd\u7b49\u540c\u4e8e\u753b\u5e03<\/strong>\u3002<\/p>\n<h3>\u65b9\u6cd5 2\uff1a==\u4f7f\u7528 plt.subplots() \u6dfb\u52a0\u753b\u5e03==<\/h3>\n<pre><code class=\"\">fig, axes = plt.subplots()\n\naxes.plot(x, y, 'r')\n<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20006.jpg\" alt=\"\" \/><\/p>\n<p>Matplotlib \u7ed8\u56fe\u975e\u5e38\u7075\u6d3b\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528 <code>add_subplot<\/code> \u6dfb\u52a0\u753b\u5e03\uff0c\u4f7f\u7528 <code>plt<\/code> \u5b8c\u6210\u7ed8\u56fe\u3002<\/p>\n<p><strong>\u65b9\u6cd5 3\uff1a\u4f7f\u7528 add_subplot() \u6dfb\u52a0\u753b\u5e03<\/strong><\/p>\n<pre><code class=\"\">fig = plt.figure() # \u65b0\u5efa\u56fe\u5f62\u5bf9\u8c61\n\nfig.add_subplot()\n\nplt.plot(x, y, 'r')\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20007.jpg\" alt=\"\" \/><\/p>\n<p>\u5bf9\u4e8e\u4e0a\u9762\u63d0\u5230\u7684 3 \u79cd\u6dfb\u52a0\u753b\u5e03\u7684\u65b9\u6cd5\uff0c\u4f60\u53ef\u80fd\u89c9\u5f97\u6709\u4e9b\u6742\u4e71\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u53ea\u9700\u8981\u719f\u6089\u5176\u4e2d\u7684\u4e00\u79cd\u5373\u53ef\uff0c\u8fd9\u91cc\u6bd4\u8f83\u63a8\u8350\u4f7f\u7528 <code>plt.subplots()<\/code>\uff0c\u800c\u4e0b\u9762\u7684\u8bb8\u591a\u4f8b\u5b50\u4e5f\u5c06\u91c7\u7528\u8fd9\u79cd\u65b9\u5f0f\u5c55\u5f00\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u65e2\u7136\u6211\u4eec\u62e5\u6709\u4e86\u753b\u677f\u548c\u753b\u5e03\uff0c\u6211\u4eec\u5e94\u8be5\u4e5f\u53ef\u4ee5\u8c03\u6574\u4e8c\u8005\u7684\u5c3a\u5bf8\uff0c\u5f62\u72b6\u5427\uff1f\u5f53\u7136\uff01<\/p>\n<p><strong>\u8c03\u8282\u753b\u5e03\u5c3a\u5bf8\u548c\u663e\u793a\u7cbe\u5ea6<\/strong><\/p>\n<pre><code class=\"\">fig, axes = plt.subplots(figsize=(16,9), dpi=50) # \u901a\u8fc7 figsize \u8c03\u8282\u5c3a\u5bf8, dpi \u8c03\u8282\u663e\u793a\u7cbe\u5ea6\n\naxes.plot(x, y, 'r')\n<\/code><\/pre>\n<h3>1.2 \u56fe\u540d\u79f0\u3001\u5750\u6807\u8f74\u540d\u79f0\u3001\u56fe\u4f8b<\/h3>\n<p><strong>\u8bbe\u7f6e\u56fe\u6807\u9898<\/strong><\/p>\n<pre><code class=\"\">ax.set_title(\"title\")\n<\/code><\/pre>\n<p><strong>\u8bbe\u7f6e\u5750\u6807\u8f74\u540d\u79f0<\/strong><\/p>\n<pre><code class=\"\">ax.set_xlabel(\"x\")\nax.set_ylabel(\"y\")\n<\/code><\/pre>\n<p><strong>\u8bbe\u7f6e\u56fe\u4f8b<\/strong><\/p>\n<pre><code class=\"\">ax.legend([\"label1\", \"label2\"])\n<\/code><\/pre>\n<p>\u4e3e\u4f8b\u5982\u4e0b\uff1a<\/p>\n<p>\u7ed8\u5236\u5305\u542b\u56fe\u6807\u9898\u3001\u5750\u6807\u8f74\u6807\u9898\u4ee5\u53ca\u56fe\u4f8b\u7684\u56fe\u5f62<\/p>\n<pre><code class=\"\">fig, axes = plt.subplots()\n\naxes.set_xlabel('x label')\naxes.set_ylabel('y label')\naxes.set_title('title')\n\naxes.plot(x, x**2)\naxes.plot(x, x**3)\naxes.legend([\"y = x**2\", \"y = x**3\"], loc=2)\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20008.jpg\" alt=\"\" \/><\/p>\n<p>\u56fe\u4f8b\u4e2d\u7684 <code>loc<\/code> \u53c2\u6570\u6807\u8bb0\u56fe\u4f8b\u4f4d\u7f6e\uff0c<code>1\uff0c2\uff0c3\uff0c4<\/code> \u4f9d\u6b21\u4ee3\u8868\uff1a\u53f3\u4e0a\u89d2\u3001\u5de6\u4e0a\u89d2\u3001\u5de6\u4e0b\u89d2\uff0c\u53f3\u4e0b\u89d2\uff1b<code>0<\/code> \u4ee3\u8868\u81ea\u9002\u5e94\u3002<\/p>\n<p>==\u6ce8\u610f\u56fe\u4f8b\u548c\u66f2\u7ebf\u7684\u5bf9\u5e94\u987a\u5e8f==<\/p>\n<h3>1.3 \u7ebf\u578b\u3001\u989c\u8272\u3001\u900f\u660e\u5ea6<\/h3>\n<p><strong>\u8bbe\u7f6e\u7ebf\u7684\u989c\u8272\u3001\u900f\u660e\u5ea6<\/strong><\/p>\n<pre><code class=\"\">fig, axes = plt.subplots()\n\naxes.plot(x, x+1, color=\"red\", alpha=0.5)\naxes.plot(x, x+2, color=\"#1155dd\")\naxes.plot(x, x+3, color=\"#15cc55\")\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20009.jpg\" alt=\"\" \/><\/p>\n<p>\u800c\u5bf9\u4e8e\u7ebf\u578b\u800c\u8a00\uff0c\u9664\u4e86\u5b9e\u7ebf\u3001\u865a\u7ebf\u4e4b\u5916\uff0c\u8fd8\u6709\u5f88\u591a\u4e30\u5bcc\u7684\u7ebf\u578b\u53ef\u4f9b\u9009\u62e9\u3002<\/p>\n<p><strong>\u8bbe\u7f6e\u7ebf\u578b<\/strong><\/p>\n<pre><code class=\"\">fig, ax = plt.subplots(figsize=(12,6))\n\n# \u7ebf\u5bbd\nax.plot(x, x+1, color=\"blue\", linewidth=0.25)\nax.plot(x, x+2, color=\"blue\", linewidth=0.50)\nax.plot(x, x+3, color=\"blue\", linewidth=1.00)\nax.plot(x, x+4, color=\"blue\", linewidth=2.00)\n\n# \u865a\u7ebf\u7c7b\u578b\nax.plot(x, x+5, color=\"red\", lw=2, linestyle='-')\nax.plot(x, x+6, color=\"red\", lw=2, ls='-.')\nax.plot(x, x+7, color=\"red\", lw=2, ls=':')\n\n# \u865a\u7ebf\u4ea4\u9519\u5bbd\u5ea6\nline, = ax.plot(x, x+8, color=\"black\", lw=1.50)\nline.set_dashes([5, 10, 15, 10])\n\n# \u7b26\u53f7\nax.plot(x, x+ 9, color=\"green\", lw=2, ls='--', marker='+')\nax.plot(x, x+10, color=\"green\", lw=2, ls='--', marker='o')\nax.plot(x, x+11, color=\"green\", lw=2, ls='--', marker='s')\nax.plot(x, x+12, color=\"green\", lw=2, ls='--', marker='1')\n\n# \u7b26\u53f7\u5927\u5c0f\u548c\u989c\u8272\nax.plot(x, x+13, color=\"purple\", lw=1, ls='-', marker='o', markersize=2)\nax.plot(x, x+14, color=\"purple\", lw=1, ls='-', marker='o', markersize=4)\nax.plot(x, x+15, color=\"purple\", lw=1, ls='-', marker='o', markersize=8, markerfacecolor=\"red\")\nax.plot(x, x+16, color=\"purple\", lw=1, ls='-', marker='s', markersize=8, \n        markerfacecolor=\"yellow\", markeredgewidth=2, markeredgecolor=\"blue\")\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20010.jpg\" alt=\"\" \/><\/p>\n<h3>1.4 \u753b\u5e03\u7f51\u683c\u3001\u5750\u6807\u8f74\u8303\u56f4<\/h3>\n<p><strong>\u8bbe\u7f6e\u753b\u5e03\u7f51\u683c\u548c\u5750\u6807\u8f74\u8303\u56f4<\/strong><\/p>\n<pre><code class=\"\">fig, axes = plt.subplots(1, 2, figsize=(10,5))\n\n# \u663e\u793a\u7f51\u683c\naxes[0].plot(x, x**2, x, x**3, lw=2)\naxes[0].grid(True)\n\n# \u8bbe\u7f6e\u5750\u6807\u8f74\u8303\u56f4\naxes[1].plot(x, x**2, x, x**3)\naxes[1].set_ylim([0, 60])\naxes[1].set_xlim([2, 5])\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20011.jpg\" alt=\"\" \/><\/p>\n<h2>2.\u5176\u4ed62D\u56fe\u5f62<\/h2>\n<h3>2.1 \u7ed8\u5236\u6563\u70b9\u56fe(scatter)\u3001\u68af\u6b65\u56fe(step)\u3001\u6761\u5f62\u56fe(bar)\u3001\u9762\u79ef\u56fe(fill_between)<\/h3>\n<pre><code class=\"\">n = np.array([0,1,2,3,4,5])\n\nfig, axes = plt.subplots(1, 4, figsize=(16,5)) \n# \u884c\u5217\u6570\u53ef\u4ee5\u7b80\u5199\n\naxes[0].scatter(x, x + 0.25*np.random.randn(len(x)))\naxes[0].set_title(\"scatter\")\n\naxes[1].step(n, n**2, lw=2) #\u7ebf\u5bbd\u53ef\u4ee5\u7b80\u5199\naxes[1].set_title(\"step\")\n\naxes[2].bar(n, n**2, align=\"center\", width=0.5, alpha=0.5) # width\u662fbar\u7684\u95f4\u8ddd\naxes[2].set_title(\"bar\")\n\naxes[3].fill_between(x, x**2, x**3, color=\"green\", alpha=0.5)\naxes[3].set_title(\"fill_between\")\n<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20012.jpg\" alt=\"\" \/><\/p>\n<h3>2.2 \u7ed8\u5236\u96f7\u8fbe\u56fe<\/h3>\n<pre><code class=\"\">fig = plt.figure(figsize=(6,6))\nax = fig.add_axes([0.0, 0.0, .6, .6], polar=True)\nt = np.linspace(0, 2 * np.pi, 100)\nax.plot(t, t, color='blue', lw=3)\n<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20013.jpg\" alt=\"\" \/><\/p>\n<h3>2.3 \u7ed8\u5236\u76f4\u65b9\u56fe<\/h3>\n<pre><code class=\"\">n = np.random.randn(100000)\nfig, axes = plt.subplots(1, 2, figsize=(12,4))\n\naxes[0].hist(n)\naxes[0].set_title(\"Default histogram\")\naxes[0].set_xlim((min(n), max(n)))\n\naxes[1].hist(n, cumulative=True, bins=50)\naxes[1].set_title(\"Cumulative detailed histogram\")\naxes[1].set_xlim((min(n), max(n)))\n<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20014.jpg\" alt=\"\" \/><\/p>\n<h3>2.4 \u7ed8\u5236\u7b49\u9ad8\u7ebf\u56fe<\/h3>\n<pre><code class=\"\"># \u751f\u6210\u793a\u4f8b\u6570\u636e\nalpha = 0.7\nphi_ext = 2 * np.pi * 0.5\n\ndef flux_qubit_potential(phi_m, phi_p):\n    return 2 + alpha - 2 * np.cos(phi_p) * np.cos(phi_m) - alpha * np.cos(phi_ext - 2*phi_p)\n\nphi_m = np.linspace(0, 2*np.pi, 100)\nphi_p = np.linspace(0, 2*np.pi, 100)\nX,Y = np.meshgrid(phi_p, phi_m)\nZ = flux_qubit_potential(X, Y).T\n<\/code><\/pre>\n<p>\u7ed8\u56fe\uff1a<\/p>\n<pre><code class=\"\">fig, ax = plt.subplots()\n\ncnt = ax.contour(Z, cmap=plt.cm.RdBu, vmin=abs(Z).min(), vmax=abs(Z).max(), extent=[0, 1, 0, 1])\n<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20015.jpg\" alt=\"\" \/><\/p>\n<h2>3. 3D\u56fe\u5f62<\/h2>\n<p>\u4f7f\u7528 Matplotlib \u7ed8\u5236 3D \u56fe\u5f62\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u5bfc\u5165 <code>Axes3D<\/code> \u7c7b\uff0c\u5e76\u901a\u8fc7 <code>projection='3d'<\/code> \u53c2\u6570\u6307\u5b9a\u7ed8\u5236 3D \u56fe\u5f62\u3002<\/p>\n<h3>3.1 \u7ed8\u5236 3D \u8868\u9762\u56fe<\/h3>\n<pre><code class=\"\">from mpl_toolkits.mplot3d.axes3d import Axes3D\n\nfig = plt.figure(figsize=(14,6))\n\n# \u901a\u8fc7 projection='3d' \u6307\u5b9a\u7ed8\u5236 3D \u56fe\u5f62\nax = fig.add_subplot(1, 2, 1, projection='3d')\nax.plot_surface(X, Y, Z, rstride=4, cstride=4, linewidth=0)\n<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20016.jpg\" alt=\"\" \/><\/p>\n<p><font color='brown'><strong>Tips\uff1a<\/strong><\/font><br \/>\n\u5f53\u6211\u4eec\u5728\u684c\u9762\u73af\u5883\u4e2d\u7ed8\u5236 3D \u56fe\u5f62\u65f6\uff0c\u662f\u53ef\u4ee5\u901a\u8fc7\u9f20\u6807\u4efb\u610f\u62d6\u52a8\u89d2\u5ea6\u7684\u3002<\/p>\n<p>\u4e0b\u9762\u518d\u7ed8\u5236\u4e00\u4e2a\u6f02\u4eae\u4e14\u590d\u6742\u4e00\u4e9b\u7684 3D \u56fe\u5f62\u3002<\/p>\n<h3>3.2 \u7ed8\u5236\u590d\u6742\u4e00\u4e9b\u7684 3D \u56fe<\/h3>\n<pre><code class=\"\">fig = plt.figure(figsize=(8,6))\n\nax = fig.add_subplot(1,1,1, projection='3d')\n\nax.plot_surface(X, Y, Z, rstride=4, cstride=4, alpha=0.25)\ncset = ax.contour(X, Y, Z, zdir='z', offset=-np.pi, cmap=plt.cm.coolwarm)\ncset = ax.contour(X, Y, Z, zdir='x', offset=-np.pi, cmap=plt.cm.coolwarm)\ncset = ax.contour(X, Y, Z, zdir='y', offset=3*np.pi, cmap=plt.cm.coolwarm)\n\nax.set_xlim3d(-np.pi, 2*np.pi)\nax.set_ylim3d(0, 3*np.pi)\nax.set_zlim3d(-np.pi, 2*np.pi)\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/essay-1256185664.cos.ap-guangzhou.myqcloud.com\/%E5%8D%9A%E6%96%87%E9%85%8D%E5%9B%BE\/19-5-9_%E4%BD%BF%E7%94%A8%20Matplotlib%20%E7%BB%98%E5%88%B6%202D%20%E5%92%8C%203D%20%E5%9B%BE%E5%BD%A2\/%E5%9B%BE%E5%83%8F%20017.jpg\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ecb\u7ecd Matplotlib \u662f\u652f\u6301 Python \u8bed\u8a00\u7684\u5f00\u6e90\u7ed8\u56fe\u5e93\uff0c\u56e0\u4e3a\u5176\u652f\u6301\u4e30\u5bcc\u7684\u7ed8\u56fe\u7c7b\u578b\u3001\u7b80\u5355\u7684\u7ed8\u56fe\u65b9\u5f0f\u4ee5\u53ca\u5b8c\u5584\u7684\u63a5\u53e3\u6587\u6863\uff0c\u6df1\u53d7 Python \u5de5\u7a0b\u5e08\u3001\u79d1\u7814\u5b66\u8005\u3001\u6570\u636e\u5de5\u7a0b\u5e08\u7b49\u5404\u7c7b\u4eba\u58eb\u7684\u559c\u6b22\u3002 \u77e5\u8bc6\u70b9 \u56fe\u540d\u79f0\u3001\u5750\u6807\u8f74\u540d\u79f0\u3001\u56fe\u4f8b \u7ebf\u578b\u3001\u989c\u8272\u3001\u900f\u660e\u5ea6 \u753b\u5e03\u7f51\u683c\u3001\u5750\u6807\u8f74\u8303\u56f4 \u5176\u4ed6 2D \u56fe\u5f62 3D \u56fe\u5f62 Matplotlib \u9762\u5411\u5bf9\u8c61 API \u5bfc\u5165\u6a21\u5757\uff1a from matplotlib import pyplot as plt \u4f7f\u7528 NumPy \u751f\u6210\u968f\u673a\u6570\u636e\uff1a &#8220;&#8221;&#8221;\u4f7f\u7528 NumPy \u751f\u6210\u968f\u673a\u6570\u636e &#8220;&#8221;&#8221; import numpy as np x = np.linspace(0, 10, 20) y = x * x + 2 1.\u7ed8\u56fe\uff1a fig = plt.figure() # \u65b0\u5efa\u56fe\u5f62\u5bf9\u8c61 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":52,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86,3,2],"tags":[18,10,11],"class_list":["post-51","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev","category-ml","category-py","tag-matplotlib","tag-python","tag-11"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62 - Nemo<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nemo.cool\/51.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62 - Nemo\" \/>\n<meta property=\"og:description\" content=\"\u4ecb\u7ecd Matplotlib \u662f\u652f\u6301 Python \u8bed\u8a00\u7684\u5f00\u6e90\u7ed8\u56fe\u5e93\uff0c\u56e0\u4e3a\u5176\u652f\u6301\u4e30\u5bcc\u7684\u7ed8\u56fe\u7c7b\u578b\u3001\u7b80\u5355\u7684\u7ed8\u56fe\u65b9\u5f0f\u4ee5\u53ca\u5b8c\u5584\u7684\u63a5\u53e3\u6587\u6863\uff0c\u6df1\u53d7 Python \u5de5\u7a0b\u5e08\u3001\u79d1\u7814\u5b66\u8005\u3001\u6570\u636e\u5de5\u7a0b\u5e08\u7b49\u5404\u7c7b\u4eba\u58eb\u7684\u559c\u6b22\u3002 \u77e5\u8bc6\u70b9 \u56fe\u540d\u79f0\u3001\u5750\u6807\u8f74\u540d\u79f0\u3001\u56fe\u4f8b \u7ebf\u578b\u3001\u989c\u8272\u3001\u900f\u660e\u5ea6 \u753b\u5e03\u7f51\u683c\u3001\u5750\u6807\u8f74\u8303\u56f4 \u5176\u4ed6 2D \u56fe\u5f62 3D \u56fe\u5f62 Matplotlib \u9762\u5411\u5bf9\u8c61 API \u5bfc\u5165\u6a21\u5757\uff1a from matplotlib import pyplot as plt \u4f7f\u7528 NumPy \u751f\u6210\u968f\u673a\u6570\u636e\uff1a &quot;&quot;&quot;\u4f7f\u7528 NumPy \u751f\u6210\u968f\u673a\u6570\u636e &quot;&quot;&quot; import numpy as np x = np.linspace(0, 10, 20) y = x * x + 2 1.\u7ed8\u56fe\uff1a fig = plt.figure() # \u65b0\u5efa\u56fe\u5f62\u5bf9\u8c61 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nemo.cool\/51.html\" \/>\n<meta property=\"og:site_name\" content=\"Nemo\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-09T13:24:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T07:51:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nemo.cool\/wp-content\/uploads\/2019\/05\/\u56fe\u50cf-017.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1145\" \/>\n\t<meta property=\"og:image:height\" content=\"854\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Nemo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nemo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html\"},\"author\":{\"name\":\"Nemo\",\"@id\":\"https:\\\/\\\/nemo.cool\\\/#\\\/schema\\\/person\\\/698f803ee811e2b140a90f5d5de913d2\"},\"headline\":\"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62\",\"datePublished\":\"2019-05-09T13:24:24+00:00\",\"dateModified\":\"2024-11-26T07:51:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html\"},\"wordCount\":37,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/#\\\/schema\\\/person\\\/698f803ee811e2b140a90f5d5de913d2\"},\"image\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/nemo.cool\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/\u56fe\u50cf-017.jpg\",\"keywords\":[\"Matplotlib\",\"python\",\"\u673a\u5668\u5b66\u4e60\"],\"articleSection\":[\"Dev\",\"ML\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nemo.cool\\\/51.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html\",\"url\":\"https:\\\/\\\/nemo.cool\\\/51.html\",\"name\":\"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62 - Nemo\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/nemo.cool\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/\u56fe\u50cf-017.jpg\",\"datePublished\":\"2019-05-09T13:24:24+00:00\",\"dateModified\":\"2024-11-26T07:51:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nemo.cool\\\/51.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html#primaryimage\",\"url\":\"https:\\\/\\\/nemo.cool\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/\u56fe\u50cf-017.jpg\",\"contentUrl\":\"https:\\\/\\\/nemo.cool\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/\u56fe\u50cf-017.jpg\",\"width\":1145,\"height\":854},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nemo.cool\\\/51.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/nemo.cool\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nemo.cool\\\/#website\",\"url\":\"https:\\\/\\\/nemo.cool\\\/\",\"name\":\"Nemo\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/#\\\/schema\\\/person\\\/698f803ee811e2b140a90f5d5de913d2\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nemo.cool\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/nemo.cool\\\/#\\\/schema\\\/person\\\/698f803ee811e2b140a90f5d5de913d2\",\"name\":\"Nemo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/nemo.cool\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/Big_Hero_6_Anime_HD_desktop_wallpaper_01_1366x768-e1706020097529-96x96.jpg\",\"url\":\"https:\\\/\\\/nemo.cool\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/Big_Hero_6_Anime_HD_desktop_wallpaper_01_1366x768-e1706020097529-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/nemo.cool\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/Big_Hero_6_Anime_HD_desktop_wallpaper_01_1366x768-e1706020097529-96x96.jpg\",\"caption\":\"Nemo\"},\"logo\":{\"@id\":\"https:\\\/\\\/nemo.cool\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/Big_Hero_6_Anime_HD_desktop_wallpaper_01_1366x768-e1706020097529-96x96.jpg\"},\"sameAs\":[\"https:\\\/\\\/nemo.cool\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62 - Nemo","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nemo.cool\/51.html","og_locale":"en_US","og_type":"article","og_title":"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62 - Nemo","og_description":"\u4ecb\u7ecd Matplotlib \u662f\u652f\u6301 Python \u8bed\u8a00\u7684\u5f00\u6e90\u7ed8\u56fe\u5e93\uff0c\u56e0\u4e3a\u5176\u652f\u6301\u4e30\u5bcc\u7684\u7ed8\u56fe\u7c7b\u578b\u3001\u7b80\u5355\u7684\u7ed8\u56fe\u65b9\u5f0f\u4ee5\u53ca\u5b8c\u5584\u7684\u63a5\u53e3\u6587\u6863\uff0c\u6df1\u53d7 Python \u5de5\u7a0b\u5e08\u3001\u79d1\u7814\u5b66\u8005\u3001\u6570\u636e\u5de5\u7a0b\u5e08\u7b49\u5404\u7c7b\u4eba\u58eb\u7684\u559c\u6b22\u3002 \u77e5\u8bc6\u70b9 \u56fe\u540d\u79f0\u3001\u5750\u6807\u8f74\u540d\u79f0\u3001\u56fe\u4f8b \u7ebf\u578b\u3001\u989c\u8272\u3001\u900f\u660e\u5ea6 \u753b\u5e03\u7f51\u683c\u3001\u5750\u6807\u8f74\u8303\u56f4 \u5176\u4ed6 2D \u56fe\u5f62 3D \u56fe\u5f62 Matplotlib \u9762\u5411\u5bf9\u8c61 API \u5bfc\u5165\u6a21\u5757\uff1a from matplotlib import pyplot as plt \u4f7f\u7528 NumPy \u751f\u6210\u968f\u673a\u6570\u636e\uff1a \"\"\"\u4f7f\u7528 NumPy \u751f\u6210\u968f\u673a\u6570\u636e \"\"\" import numpy as np x = np.linspace(0, 10, 20) y = x * x + 2 1.\u7ed8\u56fe\uff1a fig = plt.figure() # \u65b0\u5efa\u56fe\u5f62\u5bf9\u8c61 [&hellip;]","og_url":"https:\/\/nemo.cool\/51.html","og_site_name":"Nemo","article_published_time":"2019-05-09T13:24:24+00:00","article_modified_time":"2024-11-26T07:51:18+00:00","og_image":[{"width":1145,"height":854,"url":"https:\/\/nemo.cool\/wp-content\/uploads\/2019\/05\/\u56fe\u50cf-017.jpg","type":"image\/jpeg"}],"author":"Nemo","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nemo","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nemo.cool\/51.html#article","isPartOf":{"@id":"https:\/\/nemo.cool\/51.html"},"author":{"name":"Nemo","@id":"https:\/\/nemo.cool\/#\/schema\/person\/698f803ee811e2b140a90f5d5de913d2"},"headline":"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62","datePublished":"2019-05-09T13:24:24+00:00","dateModified":"2024-11-26T07:51:18+00:00","mainEntityOfPage":{"@id":"https:\/\/nemo.cool\/51.html"},"wordCount":37,"commentCount":0,"publisher":{"@id":"https:\/\/nemo.cool\/#\/schema\/person\/698f803ee811e2b140a90f5d5de913d2"},"image":{"@id":"https:\/\/nemo.cool\/51.html#primaryimage"},"thumbnailUrl":"https:\/\/nemo.cool\/wp-content\/uploads\/2019\/05\/\u56fe\u50cf-017.jpg","keywords":["Matplotlib","python","\u673a\u5668\u5b66\u4e60"],"articleSection":["Dev","ML","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nemo.cool\/51.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nemo.cool\/51.html","url":"https:\/\/nemo.cool\/51.html","name":"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62 - Nemo","isPartOf":{"@id":"https:\/\/nemo.cool\/#website"},"primaryImageOfPage":{"@id":"https:\/\/nemo.cool\/51.html#primaryimage"},"image":{"@id":"https:\/\/nemo.cool\/51.html#primaryimage"},"thumbnailUrl":"https:\/\/nemo.cool\/wp-content\/uploads\/2019\/05\/\u56fe\u50cf-017.jpg","datePublished":"2019-05-09T13:24:24+00:00","dateModified":"2024-11-26T07:51:18+00:00","breadcrumb":{"@id":"https:\/\/nemo.cool\/51.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nemo.cool\/51.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nemo.cool\/51.html#primaryimage","url":"https:\/\/nemo.cool\/wp-content\/uploads\/2019\/05\/\u56fe\u50cf-017.jpg","contentUrl":"https:\/\/nemo.cool\/wp-content\/uploads\/2019\/05\/\u56fe\u50cf-017.jpg","width":1145,"height":854},{"@type":"BreadcrumbList","@id":"https:\/\/nemo.cool\/51.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/nemo.cool\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528 Matplotlib \u7ed8\u5236 2D \u548c 3D \u56fe\u5f62"}]},{"@type":"WebSite","@id":"https:\/\/nemo.cool\/#website","url":"https:\/\/nemo.cool\/","name":"Nemo","description":"","publisher":{"@id":"https:\/\/nemo.cool\/#\/schema\/person\/698f803ee811e2b140a90f5d5de913d2"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nemo.cool\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/nemo.cool\/#\/schema\/person\/698f803ee811e2b140a90f5d5de913d2","name":"Nemo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nemo.cool\/wp-content\/uploads\/2024\/01\/Big_Hero_6_Anime_HD_desktop_wallpaper_01_1366x768-e1706020097529-96x96.jpg","url":"https:\/\/nemo.cool\/wp-content\/uploads\/2024\/01\/Big_Hero_6_Anime_HD_desktop_wallpaper_01_1366x768-e1706020097529-96x96.jpg","contentUrl":"https:\/\/nemo.cool\/wp-content\/uploads\/2024\/01\/Big_Hero_6_Anime_HD_desktop_wallpaper_01_1366x768-e1706020097529-96x96.jpg","caption":"Nemo"},"logo":{"@id":"https:\/\/nemo.cool\/wp-content\/uploads\/2024\/01\/Big_Hero_6_Anime_HD_desktop_wallpaper_01_1366x768-e1706020097529-96x96.jpg"},"sameAs":["https:\/\/nemo.cool"]}]}},"_links":{"self":[{"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":0,"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/media\/52"}],"wp:attachment":[{"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nemo.cool\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}