matplotlib 模块 画图 例2
2013-08-31 00:17
375 查看
#!/usr/bin/python # -*- coding: UTF-8 -*- import matplotlib.pyplot as plt x=[i for i in range(-20,20)] y=[i**2 for i in x] # plt.plot(x,y) # plt.plot(x,y,color="red",linestyle="-.",marker="o") #linestyle="dashed"虚线 marker="o"表示标记为圆圈 # plt.plot(x,y,"ro-") "ro-"表示红色线,标记为圆圈 简写 # plt.show() z=[i*2 for i in x] plt.plot(x,y,"ro-",x,z,"g-",[2*i for i in x ],z,"bo-") plt.show() # character color # ‘b’ blue # ‘g’ green # ‘r’ red # ‘c’ cyan # ‘m’ magenta # ‘y’ yellow # ‘k’ black # ‘w’ white # character description # '-' solid line style # '--' dashed line style # '-.' dash-dot line style # ':' dotted line style # '.' point marker # ',' pixel marker # 'o' circle marker # 'v' triangle_down marker # '^' triangle_up marker # '<' triangle_left marker # '>' triangle_right marker # '1' tri_down marker # '2' tri_up marker # '3' tri_left marker # '4' tri_right marker # 's' square marker # 'p' pentagon marker # '*' star marker # 'h' hexagon1 marker # 'H' hexagon2 marker # '+' plus marker # 'x' x marker # 'D' diamond marker # 'd' thin_diamond marker # '|' vline marker # '_' hline marker
相关文章推荐
- 利用pandas模块读取csv文件和excel表格,并用matplotlib画图
- matplotlib画图实例:pyplot、pylab模块及作图參数
- matplotlib 模块 画图 例1
- python的画图模块matplotlib
- Python实战小程序利用matplotlib模块画图代码分享
- 使用pandas模块读取csv文件和excel表格,并用matplotlib画图的方法
- Python:Matplotlib 画图(Code)
- 在python2.7.X中怎么安装numpy scipymatplotlib pandas等模块
- 数据可视化——Matplotlib模块入门(一)
- Matplotlib画图基础
- python画图_matplotlib和pandas
- liunx 环境下 python模块numpy,scipy,matplotlib 安装
- matplotlib模块数据可视化-设置图例
- scikit-learn:matplotlib.pyplot常用画图功能总结(1)
- 利用Python中的matplotlib模块抓取yahoo finance里的历史数据并绘图
- Py修行路 Matplotlib 绘图及可视化模块
- scikit-learn:matplotlib.pyplot常用画图功能总结(2)——多子图绘制
- Python应用matplotlib.pyplot画图总结
- 基于Linux系统中python matplotlib画图的中文显示问题的解决方法
- 用Python的Matplotlib模块进行基本的图像操作