现在的位置: 首页 > 综合 > 正文

Python 画图

2013年10月07日 ⁄ 综合 ⁄ 共 794字 ⁄ 字号 评论关闭

1.Turtle

海龟绘图,以“最适合教给孩子的编程语言”而闻名,可以画一些简单的图形图像和动画。

Turtle graphics is a popular way for introducing programming to kids.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an import turtle,
give it the command turtle.forward(15), and it moves (on-screen!) 15 pixels in the
direction it is facing, drawing a line as it moves. Give it the command turtle.right(25),
and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and pictures can easily be drawn.

2.Matplotlib

matplotlib适合画高质量的科学统计图表。
matplotlib is a python 2D plotting library which produces publication quality figures in a variety
of hardcopy formats and interactive environments across platforms.Matplotlib tries to make easy things easy and hard things possible.
You can generate plots, histograms, power spectra, bar charts, errorcharts, scatterplots, etc, with just a few lines of code.

抱歉!评论已关闭.