当前位置:网站首页>Matplotlib--plot markers
Matplotlib--plot markers
2022-07-30 10:14:00 【Zhuangluo orange】
目录
Draw a filled circle marker'o'
Draw a lower solid triangle marker based on the coordinate point
fmt 参数定义了基本格式,如标记、线条样式和颜色.格式fmt = '[marker][line][color]
属性
属性marker
标记 符号 描述 "."
点 ","
像素点 "o"
实心圆 "v"
下三角 "^"
上三角 "<"
左三角 ">"
右三角 "1"
下三叉 "2"
上三叉 "3"
左三叉 "4"
右三叉 "8"
八角形 "s"
正方形 "p"
五边形 "P"
加号(填充) "*"
星号 "h"
六边形 1 "H"
六边形 2 "+"
加号 "x"
乘号 x "X"
乘号 x (填充) "D"
菱形 "d"
瘦菱形 "|"
竖线 "_"
横线 0 (TICKLEFT)
左横线 1 (TICKRIGHT)
右横线 2 (TICKUP)
上竖线 3 (TICKDOWN)
下竖线 4 (CARETLEFT)
左箭头 5 (CARETRIGHT)
右箭头 6 (CARETUP)
上箭头 7 (CARETDOWN)
下箭头 8 (CARETLEFTBASE)
左箭头 (中间点为基准) 9 (CARETRIGHTBASE)
右箭头 (中间点为基准) 10 (CARETUPBASE)
上箭头 (中间点为基准) 11 (CARETDOWNBASE)
下箭头 (中间点为基准) "None", " " or "" 没有任何标记 '$...$'
渲染指定的字符.例如 "$f$" 以字母 f 为标记. 属性line
线类型标记 描述 '-' 实线 ':' 虚线 '--' 破折线 '-.' 点划线 属性color
颜色标记 描述 'r' 红色 'g' 绿色 'b' 蓝色 'c' 青色 'm' 品红 'y' 黄色 'k' 黑色 'w' 白色
Draw a filled circle marker'o'
代码
import matplotlib.pyplot as plt import numpy as np ypoints = np.array([1,3,4,5,8,9,6,1,3,4,5,2,4]) plt.plot(ypoints, marker = 'o') plt.show()
绘制*标记
代码
import matplotlib.pyplot as plt import numpy as np ypoints = np.array([1,3,4,5,8,9,6,1,3,4,5,2,4]) plt.plot(ypoints, marker = '*') plt.show()
Draw a lower solid triangle marker based on the coordinate point
代码
import matplotlib.pyplot as plt import matplotlib.markers plt.plot([1, 2, 3], marker=matplotlib.markers.CARETDOWNBASE) plt.show()
fmt 参数定义了基本格式,如标记、线条样式和颜色.格式fmt = '[marker][line][color]
代码
import matplotlib.pyplot as plt import numpy as np ypoints = np.array([6, 2, 13, 10]) plt.plot(ypoints, 'o:r') plt.show()
标记大小与颜色
我们可以自定义标记的大小与颜色,使用的参数分别是:
- markersize,简写为 ms:定义标记的大小.
- markerfacecolor,简写为 mfc:定义标记内部的颜色.
- markeredgecolor,简写为 mec:定义标记边框的颜色.
代码
import matplotlib.pyplot as plt import numpy as np ypoints = np.array([6, 2, 13, 10]) plt.plot(ypoints, marker = 'o', ms = 20) plt.show()
代码
import matplotlib.pyplot as plt import numpy as np ypoints = np.array([6, 2, 13, 10]) plt.plot(ypoints, marker = 'o', ms = 20, mec = 'r') plt.show()
代码
import matplotlib.pyplot as plt import numpy as np ypoints = np.array([6, 2, 13, 10]) plt.plot(ypoints, marker = 'o', ms = 20, mfc = 'r') plt.show()
代码
import matplotlib.pyplot as plt import numpy as np ypoints = np.array([6, 2, 13, 10]) plt.plot(ypoints, marker = 'o', ms = 20, mec = '#4CAF50', mfc = '#4CAF50') plt.show()
边栏推荐
- Practical Walkthrough | Calculate Daily Average Date or Time Interval in MySQL
- SST-Calib:结合语义和VO进行时空同步校准的lidar-visual外参标定方法(ITSC 2022)
- JCL 学习
- 多线程保证单个线程开启事务并生效的方案
- BERT pre-training model series summary
- Domino服务器SSL证书安装指南
- Re17: Read the paper Challenges for Information Extraction from Dialogue in Criminal Law
- OC-ARC(Automatic Reference Counting)自动引用计数
- 软考 系统架构设计师 简明教程 | 系统运行与软件维护
- kubernetes的一些命令
猜你喜欢

In the robot industry professionals, Mr Robot industry current situation?

多线程--线程和线程池的用法

The use of qsort function and its analog implementation

Flink_CDC搭建及简单使用

EViews 12.0 software installation package download and installation tutorial

快解析结合象过河erp

论文阅读:SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers

实战演练 | 在 MySQL 中计算每日平均日期或时间间隔

Meikle Studio - see the actual combat notes of Hongmeng device development 4 - kernel development

Redis Desktop Manager 2022.4.2 发布
随机推荐
hcip06 ospf特殊区域综合实验
[100个Solidity使用技巧]1、合约重入攻击
Shell系统学习之函数
GNOME 新功能:安全启动被禁用时警告用户
leetcode 剑指 Offer 21. 调整数组顺序使奇数位于偶数前面
kubernetes的一些命令
时刻铭记:总有一天你将破蛹而出
In the robot industry professionals, Mr Robot industry current situation?
再有人问你分布式事务,把这篇扔给他
Quick Start Tutorial for flyway
In 2022, the top will be accepted cca shut the list
leetcode 剑指 Offer 46. 把数字翻译成字符串
4、yolov5-6.0 ERROR: AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘ 解决方案
leetcode 剑指 Offer 12. 矩阵中的路径
Security思想项目总结
606. 根据二叉树创建字符串(视频讲解!!!)
Re17: Read the paper Challenges for Information Extraction from Dialogue in Criminal Law
ESP32 入门篇(一)使用 VS Code 进行开发环境安装
Day113.尚医通:微信登录二维码、登录回调接口
Container Technology - A Simple Understanding of Kubernetes Objects













































