用Python绘图 [英] Plotting with Python
问题描述
我有一个.txt文件,可以从中找到有序对,然后使用numpy和matplotlib绘制图形.例如,这些是我订购的对:
[[(4.0, 0), (0, 6.0)], [(6.0, 0), (0, 3.0)]]
(每个子列表代表最终图形中的一行)
图形如下:
但是我想找到两条线之间的交点. 如果还有更多的线路,我如何找到它们之间的共同区域?例如
SymPy还有更多功能;它适合您可能想做的大多数事情!阅读文档以了解其所有功能.
I have a .txt file from which I find ordered pairs, and then draw a graphic using numpy and matplotlib. For example these are my ordered pairs:
[[(4.0, 0), (0, 6.0)], [(6.0, 0), (0, 3.0)]]
(Each sub-list represents a line in the final graphic)
The graphic looks like this:
But I want to find the intersection between the two lines. And if there were more lines, how can I find the common area between them all? e.g.
You can start by trying SymPy for intersection (specifically) here.
There is more to SymPy; it will fit most of the things you might want to do! Read the docs for all of its capabilities.
这篇关于用Python绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!