matplotlib trisurf 移动图形时非常慢
总共有4186个数据点。
这是我的电脑配置。移动图表的速度非常慢。有没有更快的方法来绘制像矩阵一样的数据的表面图?谢谢。
而且我的电脑配置也不差。硬盘是三星SSD EVO 840,500GB。
这是根据mrcl的建议使用mayavi2绘制的表面图,我的代码如下:
import pandas as pd
a = pd.read_csv('result.csv')
import numpy as np
from mayavi import mlab
x,y,z = a.fast.values, a.slow.values, a.profit.values
mlab.points3d(x,y,z)
mlab.show()
1 个回答
1
这是一个关于如何在mayavi中使用表面绘图的例子。
import numpy
from mayavi.mlab import *
def f(x, y):
sin, cos = numpy.sin, numpy.cos
return sin(x + y) + sin(2 * x - y) + cos(3 * x + 4 * y)
x, y = numpy.mgrid[-7.:7.05:0.1, -5.:5.05:0.05]
s = surf(x, y, f(x,y))
#cs = contour_surf(x, y, f, contour_z=0)
show()
谢谢!