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条回答
疯言疯语
2楼-- · 2020-07-08 02:44

You could always write a plotting function that uses the turtle module from the standard library.

查看更多
【Aperson】
3楼-- · 2020-07-08 02:47

MathGL is GPL plotting library which have Python interface, arbitrary (including polar) curved coordinates, a lot of plot types, export to PNG, EPS, SVG, widgets, and so on. For 1D plot samples see here.

查看更多
够拽才男人
4楼-- · 2020-07-08 02:51

I suggest the most good looking plotting library for Python: CairoPlot

查看更多
放荡不羁爱自由
5楼-- · 2020-07-08 02:54

Absolutely. Matplotlib is the way to go.

The pyplot module provides a nice interface to get simple plots up and running fast, especially if you are familiar with MatLab's plotting environment. Here is a simple example using pyplot:

import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
x_points = xrange(0,9)
y_points = xrange(0,9)
p = ax.plot(x_points, y_points, 'b')
ax.set_xlabel('x-points')
ax.set_ylabel('y-points')
ax.set_title('Simple XY point plot')
fig.show()
查看更多
淡お忘
6楼-- · 2020-07-08 02:58

Have you tried to use pillow?

   from PIL import Image, ImageDraw

   #Set up canvas
   img = Image.new (mode, size)
   draw = ImageDraw.Draw (img)

   #Draw your points
   draw.point (xy, colour) 
查看更多
孤傲高冷的网名
7楼-- · 2020-07-08 03:05

Go with matplotlib Chance is that sometime in the future you might need to do more than just "simple" stuff and then you don't need to invest time learning a new plot-tool.

See this link for list of plotting tools for python...

查看更多
登录 后发表回答