{"id":1179433,"date":"2025-01-15T18:23:38","date_gmt":"2025-01-15T10:23:38","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1179433.html"},"modified":"2025-01-15T18:23:41","modified_gmt":"2025-01-15T10:23:41","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e7%94%bb%e5%87%ba%e7%ae%a1%e7%8a%b639","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1179433.html","title":{"rendered":"\u5982\u4f55\u7528python\u753b\u51fa\u7ba1\u72b639"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25113847\/d82aab51-64ae-4d0b-81e2-c21f44bb2de3.webp\" alt=\"\u5982\u4f55\u7528python\u753b\u51fa\u7ba1\u72b639\" \/><\/p>\n<p><p> \u8981\u7528Python\u7ed8\u5236\u7ba1\u72b6\u56fe\u5f62\uff0c\u53ef\u4ee5\u4f7f\u7528\u8bb8\u591a\u4e0d\u540c\u7684\u5e93\u548c\u5de5\u5177\u3002\u5176\u4e2d\uff0c\u8f83\u4e3a\u5e38\u7528\u7684\u6709Matplotlib\u3001Mayavi\u548cVTK\u7b49\u3002<strong>\u4f7f\u7528Matplotlib\u8fdb\u884c\u7b80\u5355\u76842D\u7ed8\u56fe\u3001Mayavi\u8fdb\u884c3D\u53ef\u89c6\u5316\u3001VTK\u8fdb\u884c\u590d\u6742\u76843D\u56fe\u5f62\u7ed8\u5236<\/strong>\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u51e0\u4e2a\u5de5\u5177\u6765\u7ed8\u5236\u7ba1\u72b6\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528Matplotlib\u7ed8\u5236\u7b80\u5355\u76842D\u7ba1\u72b6\u56fe\u5f62<\/h3>\n<\/p>\n<p><p>Matplotlib\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u76842D\u7ed8\u56fe\u5e93\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ed8\u5236\u5404\u79cd\u56fe\u5f62\u3002\u867d\u7136\u5b83\u4e3b\u8981\u7528\u4e8e2D\u7ed8\u56fe\uff0c\u4f46\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e9b\u6280\u5de7\u7ed8\u5236\u7b80\u5355\u76843D\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5Matplotlib<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u5df2\u5b89\u88c5Matplotlib\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528Matplotlib\u7ed8\u5236\u7ba1\u72b6\u56fe\u5f62<\/h4>\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\u6570\u636e<\/strong><\/h2>\n<p>x = np.linspace(0, 10, 100)<\/p>\n<p>y = np.sin(x)<\/p>\n<h2><strong>\u521b\u5efa\u56fe\u5f62<\/strong><\/h2>\n<p>fig, ax = plt.subplots()<\/p>\n<p>ax.plot(x, y, label=&#39;Sine Wave&#39;)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u7b7e\u548c\u6807\u9898<\/strong><\/h2>\n<p>ax.set_xlabel(&#39;X Axis&#39;)<\/p>\n<p>ax.set_ylabel(&#39;Y Axis&#39;)<\/p>\n<p>ax.set_title(&#39;Simple 2D Plot&#39;)<\/p>\n<p>ax.legend()<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u751f\u6210\u4e86\u4e00\u4e2a\u7b80\u5355\u76842D\u6b63\u5f26\u6ce2\u56fe\u5f62\u3002\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u6570\u636e\u548c\u6837\u5f0f\u6765\u521b\u5efa\u5176\u4ed6\u7c7b\u578b\u7684\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528Mayavi\u8fdb\u884c3D\u53ef\u89c6\u5316<\/h3>\n<\/p>\n<p><p>Mayavi\u662f\u4e00\u4e2a\u7528\u4e8e3D\u79d1\u5b66\u6570\u636e\u53ef\u89c6\u5316\u7684\u5f3a\u5927\u5de5\u5177\uff0c\u7279\u522b\u9002\u5408\u7528\u4e8e\u590d\u6742\u76843D\u7ed8\u56fe\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5Mayavi<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install mayavi<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528Mayavi\u7ed8\u5236\u7ba1\u72b6\u56fe\u5f62<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">from mayavi import mlab<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u5b9a\u4e49\u6570\u636e<\/strong><\/h2>\n<p>t = np.linspace(0, 4 * np.pi, 100)<\/p>\n<p>x = np.sin(t)<\/p>\n<p>y = np.cos(t)<\/p>\n<p>z = t<\/p>\n<h2><strong>\u7ed8\u5236\u7ba1\u72b6\u56fe\u5f62<\/strong><\/h2>\n<p>mlab.plot3d(x, y, z, tube_radius=0.1, color=(0, 1, 0))<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>mlab.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u4f7f\u7528Mayavi\u5e93\u7ed8\u5236\u4e86\u4e00\u4e2a3D\u87ba\u65cb\u7ba1\u72b6\u56fe\u5f62\u3002\u901a\u8fc7\u8c03\u6574\u53c2\u6570\uff0c\u53ef\u4ee5\u521b\u5efa\u4e0d\u540c\u76843D\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528VTK\u8fdb\u884c\u590d\u6742\u76843D\u56fe\u5f62\u7ed8\u5236<\/h3>\n<\/p>\n<p><p>VTK\uff08The Visualization Toolkit\uff09\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u76843D\u56fe\u5f62\u5e93\uff0c\u9002\u7528\u4e8e\u590d\u6742\u76843D\u5efa\u6a21\u548c\u53ef\u89c6\u5316\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5VTK<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install vtk<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528VTK\u7ed8\u5236\u7ba1\u72b6\u56fe\u5f62<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import vtk<\/p>\n<h2><strong>\u521b\u5efa\u5706\u67f1\u4f53\u6570\u636e\u6e90<\/strong><\/h2>\n<p>cylinder = vtk.vtkCylinderSource()<\/p>\n<p>cylinder.SetResolution(50)<\/p>\n<h2><strong>\u521b\u5efa\u6620\u5c04\u5668<\/strong><\/h2>\n<p>mapper = vtk.vtkPolyDataMapper()<\/p>\n<p>mapper.SetInputConnection(cylinder.GetOutputPort())<\/p>\n<h2><strong>\u521b\u5efa\u6f14\u5458<\/strong><\/h2>\n<p>actor = vtk.vtkActor()<\/p>\n<p>actor.SetMapper(mapper)<\/p>\n<h2><strong>\u521b\u5efa\u6e32\u67d3\u5668<\/strong><\/h2>\n<p>renderer = vtk.vtkRenderer()<\/p>\n<p>renderer.AddActor(actor)<\/p>\n<p>renderer.SetBackground(0.1, 0.2, 0.4)<\/p>\n<h2><strong>\u521b\u5efa\u6e32\u67d3\u7a97\u53e3<\/strong><\/h2>\n<p>render_window = vtk.vtkRenderWindow()<\/p>\n<p>render_window.AddRenderer(renderer)<\/p>\n<h2><strong>\u521b\u5efa\u4ea4\u4e92\u6e32\u67d3\u5668<\/strong><\/h2>\n<p>render_window_interactor = vtk.vtkRenderWindowInteractor()<\/p>\n<p>render_window_interactor.SetRenderWindow(render_window)<\/p>\n<h2><strong>\u5f00\u59cb\u4ea4\u4e92<\/strong><\/h2>\n<p>render_window.Render()<\/p>\n<p>render_window_interactor.Start()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u4f7f\u7528VTK\u5e93\u521b\u5efa\u4e86\u4e00\u4e2a\u7b80\u5355\u76843D\u5706\u67f1\u4f53\u56fe\u5f62\u3002\u901a\u8fc7\u8fdb\u4e00\u6b65\u8c03\u6574\u4ee3\u7801\u548c\u53c2\u6570\uff0c\u53ef\u4ee5\u521b\u5efa\u66f4\u52a0\u590d\u6742\u548c\u591a\u6837\u76843D\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u5e94\u7528\u573a\u666f\u548c\u6269\u5c55<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4ee5\u4e0a\u4e09\u79cd\u5de5\u5177\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u4f7f\u7528\u3002<strong>Matplotlib\u9002\u7528\u4e8e\u7b80\u5355\u76842D\u548c\u57fa\u672c\u76843D\u7ed8\u56fe\u3001Mayavi\u9002\u7528\u4e8e\u79d1\u5b66\u6570\u636e\u76843D\u53ef\u89c6\u5316\u3001VTK\u5219\u9002\u7528\u4e8e\u590d\u6742\u76843D\u5efa\u6a21\u548c\u53ef\u89c6\u5316<\/strong>\u3002<\/p>\n<\/p>\n<p><h4>1. \u79d1\u5b66\u7814\u7a76<\/h4>\n<\/p>\n<p><p>\u5728\u79d1\u5b66\u7814\u7a76\u4e2d\uff0c\u6570\u636e\u7684\u53ef\u89c6\u5316\u975e\u5e38\u91cd\u8981\u3002\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5c06\u590d\u6742\u7684\u6570\u636e\u8f6c\u5316\u4e3a\u76f4\u89c2\u7684\u56fe\u5f62\uff0c\u5e2e\u52a9\u7406\u89e3\u548c\u5206\u6790\u3002<\/p>\n<\/p>\n<p><h4>2. \u5de5\u7a0b\u8bbe\u8ba1<\/h4>\n<\/p>\n<p><p>\u5728\u5de5\u7a0b\u8bbe\u8ba1\u4e2d\uff0c3D\u5efa\u6a21\u548c\u53ef\u89c6\u5316\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u5de5\u5177\u3002\u4f7f\u7528VTK\u7b49\u5e93\uff0c\u53ef\u4ee5\u521b\u5efa\u590d\u6742\u76843D\u6a21\u578b\uff0c\u8fdb\u884c\u4eff\u771f\u548c\u5206\u6790\u3002<\/p>\n<\/p>\n<p><h4>3. \u6559\u5b66\u548c\u6f14\u793a<\/h4>\n<\/p>\n<p><p>\u5728\u6559\u5b66\u548c\u6f14\u793a\u4e2d\uff0c\u751f\u52a8\u7684\u56fe\u5f62\u548c\u6a21\u578b\u53ef\u4ee5\u5e2e\u52a9\u5b66\u751f\u66f4\u597d\u5730\u7406\u89e3\u62bd\u8c61\u7684\u6982\u5ff5\u3002\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\uff0c\u53ef\u4ee5\u521b\u5efa\u5404\u79cd\u7c7b\u578b\u7684\u56fe\u5f62\u548c\u6a21\u578b\uff0c\u589e\u5f3a\u6559\u5b66\u6548\u679c\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u7efc\u5408\u5b9e\u4f8b<\/h3>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u7efc\u5408\u4f7f\u7528\u4ee5\u4e0a\u5de5\u5177\uff0c\u521b\u5efa\u4e00\u4e2a\u590d\u6742\u76843D\u7ba1\u72b6\u56fe\u5f62\uff0c\u5e76\u8fdb\u884c\u8be6\u7ec6\u7684\u8bb2\u89e3\u3002<\/p>\n<\/p>\n<p><h4>1. \u521b\u5efa\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u5b9a\u4e49\u7ba1\u72b6\u56fe\u5f62\u7684\u6570\u636e\u3002\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528\u53c2\u6570\u65b9\u7a0b\u751f\u6210\u4e00\u4e2a\u87ba\u65cb\u7ba1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u5b9a\u4e49\u53c2\u6570<\/strong><\/h2>\n<p>t = np.linspace(0, 4 * np.pi, 100)<\/p>\n<p>x = np.sin(t)<\/p>\n<p>y = np.cos(t)<\/p>\n<p>z = t<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528Mayavi\u7ed8\u52363D\u7ba1\u72b6\u56fe\u5f62<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Mayavi\u7ed8\u5236\u4e00\u4e2a\u87ba\u65cb\u7ba1\u72b6\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from mayavi import mlab<\/p>\n<h2><strong>\u7ed8\u5236\u7ba1\u72b6\u56fe\u5f62<\/strong><\/h2>\n<p>mlab.plot3d(x, y, z, tube_radius=0.1, color=(1, 0, 0))<\/p>\n<h2><strong>\u663e\u793a\u56fe\u5f62<\/strong><\/h2>\n<p>mlab.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u4f7f\u7528VTK\u7ed8\u5236\u590d\u6742\u76843D\u7ba1\u72b6\u56fe\u5f62<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528VTK\u521b\u5efa\u4e00\u4e2a\u66f4\u52a0\u590d\u6742\u76843D\u7ba1\u72b6\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import vtk<\/p>\n<h2><strong>\u521b\u5efa\u70b9\u6570\u636e<\/strong><\/h2>\n<p>points = vtk.vtkPoints()<\/p>\n<p>for i in range(len(t)):<\/p>\n<p>    points.InsertNextPoint(x[i], y[i], z[i])<\/p>\n<h2><strong>\u521b\u5efa\u7ebf\u5355\u5143<\/strong><\/h2>\n<p>lines = vtk.vtkCellArray()<\/p>\n<p>for i in range(len(t) - 1):<\/p>\n<p>    lines.InsertNextCell(2)<\/p>\n<p>    lines.InsertCellPoint(i)<\/p>\n<p>    lines.InsertCellPoint(i + 1)<\/p>\n<h2><strong>\u521b\u5efa\u7ba1\u72b6\u6570\u636e<\/strong><\/h2>\n<p>tube = vtk.vtkTubeFilter()<\/p>\n<p>poly_data = vtk.vtkPolyData()<\/p>\n<p>poly_data.SetPoints(points)<\/p>\n<p>poly_data.SetLines(lines)<\/p>\n<p>tube.SetInputData(poly_data)<\/p>\n<p>tube.SetRadius(0.1)<\/p>\n<p>tube.SetNumberOfSides(50)<\/p>\n<h2><strong>\u521b\u5efa\u6620\u5c04\u5668<\/strong><\/h2>\n<p>mapper = vtk.vtkPolyDataMapper()<\/p>\n<p>mapper.SetInputConnection(tube.GetOutputPort())<\/p>\n<h2><strong>\u521b\u5efa\u6f14\u5458<\/strong><\/h2>\n<p>actor = vtk.vtkActor()<\/p>\n<p>actor.SetMapper(mapper)<\/p>\n<h2><strong>\u521b\u5efa\u6e32\u67d3\u5668<\/strong><\/h2>\n<p>renderer = vtk.vtkRenderer()<\/p>\n<p>renderer.AddActor(actor)<\/p>\n<p>renderer.SetBackground(0.1, 0.2, 0.4)<\/p>\n<h2><strong>\u521b\u5efa\u6e32\u67d3\u7a97\u53e3<\/strong><\/h2>\n<p>render_window = vtk.vtkRenderWindow()<\/p>\n<p>render_window.AddRenderer(renderer)<\/p>\n<h2><strong>\u521b\u5efa\u4ea4\u4e92\u6e32\u67d3\u5668<\/strong><\/h2>\n<p>render_window_interactor = vtk.vtkRenderWindowInteractor()<\/p>\n<p>render_window_interactor.SetRenderWindow(render_window)<\/p>\n<h2><strong>\u5f00\u59cb\u4ea4\u4e92<\/strong><\/h2>\n<p>render_window.Render()<\/p>\n<p>render_window_interactor.Start()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u4f7f\u7528VTK\u5e93\u521b\u5efa\u4e86\u4e00\u4e2a\u590d\u6742\u76843D\u87ba\u65cb\u7ba1\u72b6\u56fe\u5f62\u3002\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u53ef\u4ee5\u7ed8\u5236\u4e0d\u540c\u7c7b\u578b\u7684\u7ba1\u72b6\u56fe\u5f62\uff0c\u5e76\u8fdb\u884c\u53ef\u89c6\u5316\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u5185\u5bb9\uff0c\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Python\u4e2d\u7684Matplotlib\u3001Mayavi\u548cVTK\u5e93\u7ed8\u5236\u7ba1\u72b6\u56fe\u5f62\u3002\u6bcf\u79cd\u5de5\u5177\u90fd\u6709\u5176\u7279\u70b9\u548c\u9002\u7528\u573a\u666f\uff0c<strong>Matplotlib\u9002\u5408\u7b80\u5355\u76842D\u7ed8\u56fe\u3001Mayavi\u9002\u5408\u79d1\u5b66\u6570\u636e\u76843D\u53ef\u89c6\u5316\u3001VTK\u9002\u5408\u590d\u6742\u76843D\u5efa\u6a21<\/strong>\u3002\u5e0c\u671b\u901a\u8fc7\u8fd9\u4e9b\u793a\u4f8b\uff0c\u60a8\u80fd\u591f\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u8fd9\u4e9b\u5de5\u5177\uff0c\u521b\u5efa\u51fa\u7b26\u5408\u9700\u6c42\u7684\u56fe\u5f62\u548c\u6a21\u578b\u3002<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\uff0c\u5e76\u7ed3\u5408\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u8c03\u6574\u548c\u4f18\u5316\u3002\u5e0c\u671b\u8fd9\u4e9b\u5185\u5bb9\u5bf9\u60a8\u7684\u5de5\u4f5c\u548c\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684\u5e93\u6765\u7ed8\u5236\u7ba1\u72b639\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u6709\u591a\u4e2a\u5e93\u53ef\u4ee5\u7528\u6765\u7ed8\u52363D\u56fe\u5f62\uff0c\u4f8b\u5982Matplotlib\u3001Mayavi\u548cPlotly\u7b49\u3002Matplotlib\u662f\u6700\u5e38\u7528\u7684\u7ed8\u56fe\u5e93\uff0c\u9002\u5408\u521d\u5b66\u8005\uff1b\u800cMayavi\u548cPlotly\u5728\u5904\u7406\u590d\u6742\u76843D\u53ef\u89c6\u5316\u65b9\u9762\u8868\u73b0\u66f4\u4f73\u3002\u9009\u62e9\u5408\u9002\u7684\u5e93\u53d6\u51b3\u4e8e\u4f60\u5bf9\u56fe\u5f62\u590d\u6742\u5ea6\u548c\u4ea4\u4e92\u6027\u7684\u9700\u6c42\u3002<\/p>\n<p><strong>\u7ba1\u72b639\u7684\u5177\u4f53\u7ed8\u5236\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u7ed8\u5236\u7ba1\u72b639\u7684\u6b65\u9aa4\u901a\u5e38\u5305\u62ec\uff1a\u5b89\u88c5\u6240\u9700\u5e93\u3001\u521b\u5efa\u6570\u636e\u96c6\u3001\u8bbe\u7f6e\u7ed8\u56fe\u53c2\u6570\u3001\u751f\u6210\u7ba1\u9053\u7684\u51e0\u4f55\u5f62\u72b6\uff0c\u5e76\u6700\u7ec8\u5c06\u5176\u53ef\u89c6\u5316\u3002\u5177\u4f53\u5b9e\u73b0\u4e2d\uff0c\u9700\u8981\u5148\u5b9a\u4e49\u7ba1\u9053\u7684\u53c2\u6570\uff0c\u5982\u534a\u5f84\u3001\u957f\u5ea6\u548c\u8def\u5f84\uff0c\u7136\u540e\u5229\u7528\u6240\u9009\u5e93\u7684\u51fd\u6570\u8fdb\u884c\u7ed8\u5236\u3002<\/p>\n<p><strong>\u5728\u7ed8\u5236\u8fc7\u7a0b\u4e2d\u5982\u4f55\u5904\u7406\u6570\u636e\u7684\u51c6\u786e\u6027\u548c\u53ef\u89c6\u5316\u6548\u679c\uff1f<\/strong><br \/>\u4e3a\u4e86\u786e\u4fdd\u6570\u636e\u7684\u51c6\u786e\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528NumPy\u7b49\u5e93\u8fdb\u884c\u6570\u503c\u8ba1\u7b97\u548c\u6570\u636e\u5904\u7406\u3002\u5728\u53ef\u89c6\u5316\u6548\u679c\u65b9\u9762\uff0c\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u56fe\u5f62\u7684\u989c\u8272\u3001\u900f\u660e\u5ea6\u548c\u5149\u7167\u6548\u679c\u7b49\u53c2\u6570\u6765\u63d0\u9ad8\u53ef\u8bfb\u6027\u548c\u7f8e\u89c2\u6027\u3002\u6b64\u5916\uff0c\u6dfb\u52a0\u6807\u7b7e\u548c\u6ce8\u91ca\u4e5f\u80fd\u591f\u5e2e\u52a9\u89c2\u4f17\u66f4\u597d\u5730\u7406\u89e3\u56fe\u5f62\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u7528Python\u7ed8\u5236\u7ba1\u72b6\u56fe\u5f62\uff0c\u53ef\u4ee5\u4f7f\u7528\u8bb8\u591a\u4e0d\u540c\u7684\u5e93\u548c\u5de5\u5177\u3002\u5176\u4e2d\uff0c\u8f83\u4e3a\u5e38\u7528\u7684\u6709Matplotlib\u3001Mayavi [&hellip;]","protected":false},"author":3,"featured_media":1179439,"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\/1179433"}],"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=1179433"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1179433\/revisions"}],"predecessor-version":[{"id":1179443,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1179433\/revisions\/1179443"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1179439"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1179433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1179433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1179433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}