转换2个阵列成在python矩阵

问题描述 投票:-1回答:1

我有我读入Python中的矩阵坐标文件。我想创建一个三角网和用线连接在一起的坐标绘制。我有以下的代码创建了德劳内,但我不能确定如何绘制。任何帮助将不胜感激。代码如下:

from matplotlib.pyplot import scatter
import numpy as np
import itertools 

f2 = open('coordinates.txt')
lines = f2.read()
sLines = lines.split('\n')
sLines = sLines[0:-1]

points = []
for lines in sLines:
    points.append(lines.split())

from scipy.spatial import Delaunay
tri = Delaunay(points)

坐标文件如下:

0.73452853     0.00000000
0.00000000     0.00000000
0.42535691     0.18628529
0.62959588     0.00000000
0.52466324     0.00000000
0.41973059     0.00000000
0.31479794     0.00000000
0.20986529     0.00000000
0.10493265     0.00000000
python matplotlib triplot
1个回答
0
投票

看看为Delaunay,其中包括如何绘制镶嵌一个例子的SciPy的文档。

© www.soinside.com 2019 - 2024. All rights reserved.