matplotlib基础
2016-12-18 10:50
411 查看
1 windows安装
Python安装文件集成了matplotlib,只是注意安装的时候,选项中要把tcl/tck勾上,不然运行的时候会报错。2 导入
import matplotlib.pyplot as plt教程标题 | 主要内容 |
---|---|
关于Markdown | 简介Markdown,Markdown的优缺点 |
Markdown基础 | Markdown的基本语法,格式化文本、代码、列表、链接和图片、分割线、转义符等 |
Markdown表格和公式 | Markdown的扩展语法,表格、公式 |
3 画点(plot)
plot方法一般是画线,但是如果只给一个点的坐标,也可以画点。(pyplot似乎把点称为marker)比如:
plt.plot(20, 30, "+")
plot api文档
除了坐标之外还必须指定点的形状否则看不到画的点。
plot方法的调用有两种形式:
1 plt.plot(x, y, “内置形状|颜色”)
2 plt.plot(x, y, color=’red’, marker=’o’, markerfacecolor=’blue’, markersize=12) color和makerfacecolor指定一个就行了,如果两者同时出现,已后者为准。
内置形状如下表:
marker | description |
---|---|
”.” | point |
”,” | pixel |
“o” | circle |
“v” | triangle_down |
“^” | triangle_up |
“<” | triangle_left |
“>” | triangle_right |
“1” | tri_down |
“2” | tri_up |
“3” | tri_left |
“4” | tri_right |
“8” | octagon |
“s” | square |
“p” | pentagon |
“*” | star |
“h” | hexagon1 |
“H” | hexagon2 |
“+” | plus |
“x” | x |
“D” | diamond |
“d” | thin_diamond |
“ | ” |
“_” | hline |
内置颜色:
character | color |
---|---|
‘b’ | blue |
‘g’ | green |
‘r’ | red |
‘c’ | cyan |
‘m’ | magenta |
‘y’ | yellow |
‘k’ | black |
‘w’ | white |
including full names (‘green’), hex strings (‘#008000’), RGB or RGBA tuples ((0,1,0,1)) or grayscale intensities as a string (‘0.8’)
相关文章推荐
- matplotlib 2D绘图基础
- python matplotlib 基础
- windows64位Python3.5.2基础上,安装numpy、matplotlib、scipy(whl文件)安装tensorflow及sklearn包
- Matplotlib画图基础
- Python可视化学习(2):Matplotlib快速绘图基础
- matplotlib画图基础,华氏温度到摄氏温度的转换
- python之matplotlib绘图基础
- Python高级数据处理与可视化(二)---Matplotlib绘图基础
- [笔记]SciPy、Matplotlib基础操作
- matplotlib绘图基础--2
- matplotlib油漆基础
- CS231n-机器学习中matplotlib绘图基础.md
- matplotlib 基础
- matplotlib绘图基础
- matplotlib基础
- Matplotlib 基础
- matplotlib绘图基础
- 【Linux基础】Linux/Windows下安装python、Numpy、Matplotlib
- matplotlib绘图基础
- matplotlib绘图基础--3