使用Python在图形中打印浮点(x,y)数据

使用Python在图形中打印浮点(x,y)数据,python,matplotlib,Python,Matplotlib,我需要以以下格式打印保存在文件中的数据: 0.1545,0.68954 0.1548,0.87854 0.2545,0.54854 0.7956,0.41548 (所有值均在0.0和1.0之间) 以及在同一图形中打印多个图形以区分它们的可能性(即:颜色或线条样式) 我被告知要使用python来实现这一点,因为它很简单,但我读过的所有文档和类似的示例都不适合我 如果有人能帮我写论文,我将不胜感激。我只需要python进行图形打印,没有时间深入学习。要加载数据: # open the file

我需要以以下格式打印保存在文件中的数据:

0.1545,0.68954
0.1548,0.87854
0.2545,0.54854
0.7956,0.41548 
(所有值均在0.0和1.0之间) 以及在同一图形中打印多个图形以区分它们的可能性(即:颜色或线条样式)

我被告知要使用python来实现这一点,因为它很简单,但我读过的所有文档和类似的示例都不适合我

如果有人能帮我写论文,我将不胜感激。我只需要python进行图形打印,没有时间深入学习。

要加载数据:

# open the file so you can read from it
with open("myfile.txt") as inf:
    # for each line in the file,
    # split it on commas (results in a list of strings)
    # then convert each string to a float (results in a list of floats)
    items = (map(float, line.split(",")) for line in inf)
    # transpose (convert columns to rows),
    # then assign each row to a variable)
    xs, ys = zip(*items)
要绘制它:

import matplotlib.pyplot as plt

plt.scatter(xs, ys)
plt.show()

为什么不自己编写代码呢?matplotlib中到底有什么不适合您?你能详细解释一下吗?为什么你不能用wolfram alpha之类的东西来绘制你的点呢?