用Python绘图 [英] Plotting with Python

查看:60
本文介绍了用Python绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.txt文件,可以从中找到有序对,然后使用numpy和matplotlib绘制图形.例如,这些是我订购的对:

[[(4.0, 0), (0, 6.0)], [(6.0, 0), (0, 3.0)]]

(每个子列表代表最终图形中的一行)

图形如下:

但是我想找到两条线之间的交点. 如果还有更多的线路,我如何找到它们之间的共同区域?例如

解决方案

您可以先尝试 SymPy (特别是)此处.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆