matplotlib基础
来源:互联网 发布:淘宝质检在哪里上传 编辑:程序博客网 时间:2024/06/05 23:51
1 windows安装
Python安装文件集成了matplotlib,只是注意安装的时候,选项中要把tcl/tck勾上,不然运行的时候会报错。
2 导入
import matplotlib.pyplot as plt
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指定一个就行了,如果两者同时出现,已后者为准。
内置形状如下表:
完整的内容可以参考官方文档
内置颜色:
除了内置颜色,根据plot文档,还可以有其他方式:
including full names (‘green’), hex strings (‘#008000’), RGB or RGBA tuples ((0,1,0,1)) or grayscale intensities as a string (‘0.8’)
0 0
- Matplotlib 基础
- matplotlib基础
- matplotlib基础
- matplotlib基础
- matplotlib基础
- matplotlib绘图基础
- python matplotlib 基础
- matplotlib绘图基础
- matplotlib绘图基础
- matplotlib绘图基础
- 9、matplotlib 基础入门
- Matplotlib画图基础
- matplotlib绘图基础--1
- matplotlib绘图基础--2
- matplotlib绘图基础--3
- Python之matplotlib基础
- matplotlib绘图基础
- Numpy 和 Matplotlib 基础
- Scala中break与continue的用法
- The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaini
- ABAP 提取或去除字符串中的中文字符(双字节字符)
- Java多线程设计(二)线程的基本知识(1)
- Java学习笔记五:Object类,equals ==,toString
- matplotlib基础
- PHP进阶 第2章 函数
- linux下安装mysql5.7.17及简单配置
- 禁用校园网烦人的客户端下载自动弹窗
- 将地址赋值给指针
- c++基础练习
- TensorFlow深度学习,一篇文章就够了
- VLFeat-使用matlab版本计算HOG
- 线程的一些知识