matplotlib无法获得所需的图解

时间:2019-04-13 17:55:15

标签: python matplotlib plot

因此,我需要在一个漂亮的3D图中绘制一些数据。在使用一些库进行3D绘图后,我使用plotly获得了数据的最佳绘图,看起来像这样 enter image description here
这正是我需要的情节。但是,plotly的免费版本只能让您将图保存为png或jpeg,而不能导出为我需要的矢量图形格式,如svg或eps。 因此,我转到了另一个受欢迎的库,即python matplotlib。使用此脚本,

import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt


fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# some calculations here

ax.plot_surface(x, y, z, cmap='coolwarm', rstride=5,
                cstride=10, vmin=-1.65447, vmax=-1.4)
ax.set_zlim(-1.65447, -1.4)
plt.show()

这给了我情节 enter image description here

现在,这看起来完全是混乱和丑陋的。这里最大的问题是Z轴在-1.4处没有被切割。我对matplotlib没有更深入的了解,所以我不知道该如何解决。因此,如何使情节变得更好,更像我想要的漂亮多情节情节。

0 个答案:

没有答案
相关问题