Plotting points in python

2020-07-08 02:16发布

I want to plot some (x,y) points on the same graph and I don't need any special features at all short of support for polar coordinates which would be nice but not necessary. It's mostly for visualizing my data. Is there a simple way to do this? Matplotlib seems like way more than I need right now. Are there any more basic modules available? What do You recommend?

标签: python plot
8条回答
ゆ 、 Hurt°
2楼-- · 2020-07-08 03:06
import matplotlib.pyplot as plt 
x = range(1,10) 
y = range(1,10) 
plt.plot(x,y,'o')
plt.show()

Here's a simple line with made up x, y. Note: x and y are lists.

Their lengths should be equal or you'll get a error. Cheers!

查看更多
一夜七次
3楼-- · 2020-07-08 03:11

You can use the Tkinter canvas widget. It uses rectangular coordinates but of course you can translate to polar. The canvas is pretty much just like it sounds -- a blank canvas on which you can draw points, lines, circles, rectangles, etc.

查看更多
登录 后发表回答