用python画三维图、某区域的高程 | 您所在的位置:网站首页 › 三维坐标经度纬度高程 › 用python画三维图、某区域的高程 |
我在matplotlib网站上找到了这个脚本:""" Demonstrates using custom hillshading in a 3D surface plot. """ from mpl_toolkits.mplot3d import Axes3D from matplotlib import cbook from matplotlib import cm from matplotlib.colors import LightSource import matplotlib.pyplot as plt import numpy as np filename = cbook.get_sample_data('jacksboro_fault_dem.npz', asfileobj=False) with np.load(filename) as dem: z = dem['elevation'] nrows, ncols = z.shape x = np.linspace(dem['xmin'], dem['xmax'], ncols) y = np.linspace(dem['ymin'], dem['ymax'], nrows) x, y = np.meshgrid(x, y) region = np.s_[5:50, 5:50] x, y, z = x[region], y[region], z[region] fig, ax = plt.subplots(subplot_kw=dict(projection='3d')) ls = LightSource(270, 45) |
CopyRight 2018-2019 实验室设备网 版权所有 |