我试图使用data attached here创建一个类似于图像的绘图,但是当我试图绘制网格数据时,我遇到了内存错误。在
我只能使用matplotlib中的scatter选项打印文件,如下例所示:
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from scipy.interpolate import griddata
dffold = pd.read_csv('foldmap.toc', delimiter='\t',encoding='latin1',usecols=['Inline','Crossline','X','Y','Fold'])
x1 = np.array(dffold.X)
y1 = np.array(dffold.Y)
zf = np.array(dffold.Fold)
xi = np.linspace(min(x1), max(x1))
yi = np.linspace(min(y1), max(y1))
A, B = np.meshgrid(xi, yi, copy=False)
zi = griddata((x1, y1), zf , (xi, yi), method='nearest')
plt.scatter(x1,y1,zf)
plt.show()
目前没有回答
相关问题 更多 >
编程相关推荐