Matplotlib:tick_params参数设置
1.tick_params语法
参数:
axis : {‘x’, ‘y’, ‘both’} Axis on which to operate; default is ‘both’.
reset : bool If True, set all parameters to defaults before processing other keyword arguments. Default is False.
which : {‘major’, ‘minor’, ‘both’} Default is ‘major’; apply arguments to which ticks.
direction : {‘in’, ‘out’, ‘inout’} Puts ticks inside the axes, outside the axes, or both.
length : float Tick length in points.
width : float Tick width in points.
color : color Tick color; accepts any mpl color spec.
pad : float Distance in points between tick and label.
labelsize : float or str Tick label font size in points or as a string (e.g., ‘large’).
labelcolor : color Tick label color; mpl color spec.
colors : color Changes the tick color and the label color to the same value: mpl color spec.
zorder : float Tick and label zorder.
bottom, top, left, right : bool or {‘on’, ‘off’} controls whether to draw the respective ticks.
labelbottom, labeltop, labelleft, labelright : bool or {‘on’, ‘off’} controls whether to draw the respective tick labels.
labelrotation : float Tick label rotation
2.tick_params例子:
(1)参数axis的值为'x'、'y'、'both',分别代表设置X轴、Y轴以及同时设置,默认值为'both'。
ax1.tick_params(axis='x',width=2,colors='gold')
ax2.tick_params(axis='y',width=2,colors='gold')
ax3.tick_params(axis='both',width=2,colors='gold')
(2)参数which的值为 'major'、'minor'、'both',分别代表设置主刻度线、副刻度线以及同时设置,默认值为'major'
ax1.tick_params(which='major',width=2,colors='gold')
ax2.tick_params(which='minor',width=2,colors='gold')
ax3.tick_params(which='both',width=2,colors='gold')
(3)参数direction的值为'in'、'out'、'inout',分别代表刻度线显示在绘图区内侧、外侧以及同时显示
ax1.tick_params(direction='in',width=2,length=4,colors='gold')
ax2.tick_params(direction='out',width=2,length=4,colors='gold')
ax3.tick_params(direction='inout',width=2,length=4,colors='gold')
(4)length和width
参数length和width分别用于设置刻度线的长度和宽度
ax2.tick_params(width=4,colors='gold')
ax3.tick_params(length=10,colors='gold')
(5)参数pad用于设置刻度线与标签间的距离
ax2.tick_params(pad=1,colors='gold')
ax3.tick_params(pad=10,colors='gold')
(6)参数color、labelcolor、colors分别用于设置刻度线的颜色、刻度线标签的颜色以及同时设置刻度线及标签颜色
ax1.tick_params(width=4,color='gold')
ax2.tick_params(width=4,labelcolor='gold')
ax3.tick_params(width=4,colors='gold')
(7)参数labelsize用于设置刻度线标签的字体大小
ax1.tick_params(labelsize='medium')
ax2.tick_params(labelsize='large')
ax3.tick_params(labelsize=15)
(8)参数bottom, top, left, right的值为布尔值,分别代表设置绘图区四个边框线上的的刻度线是否显示
ax1.tick_params(bottom=False,top=True,width=4,colors='gold')
ax2.tick_params(left=False,right=True,width=4,colors='gold')
ax3.tick_params(top=True,right=True,width=4,colors='gold')
(9)参数labelbottom, labeltop, labelleft, labelright的值为布尔值,分别代表设置绘图区四个边框线上的刻度线标签是否显示
ax1.tick_params(labelbottom=False,labeltop=True,width=4,colors='gold')
ax2.tick_params(labelleft=False,labelright=True,width=4,colors='gold')
ax3.tick_params(labeltop=True,labelright=True,width=4,colors='gold')
Matplotlib:tick_params参数设置的更多相关文章
- python matplotlib 中文显示参数设置
python matplotlib 中文显示参数设置 方法一:每次编写代码时进行参数设置 #coding:utf-8import matplotlib.pyplot as pltplt.rcParam ...
- matplotlib 中的一些参数设置
首先:在pycharm 中要使图显示出来,最后一定要加上 plt.show(),如: plt.bar(x, y) plt.show() 下面就是我使用 matplotlib 遇到的一些常用参数设置: ...
- 手把手教从零开始在GitHub上使用Hexo搭建博客教程(二)-Hexo参数设置
前言 前文手把手教从零开始在GitHub上使用Hexo搭建博客教程(一)-附GitHub注册及配置介绍了github注册.git相关设置以及hexo基本操作. 本文主要介绍一下hexo的常用参数设置. ...
- jqGrid的autoencode参数设置为true在客户端可能引发的编码问题
不久前使用jqGrid+MVC做过一段时间开发. 一开始,分页参数几乎都是默认值,jqGrid的分页功能很好用. 考虑到each input is evil,我们的系统对安全性又有较高要求,所以,为了 ...
- Hibernate 参数设置一览表
Hibernate 参数设置一览表 属性名 用途 hibernate.dialect 一个Hibernate Dialect类名允许Hibernate针对特定的关系数据库生成优化的SQL. 取值 fu ...
- 使用MEF实现通用参数设置
通用后台管理系统必备功能模块包含日志管理,权限管理,数据字典,参数配置等功能.参数设置主要用于设置系统运行所需的一些基础性配置项,比如redis缓存,mq消息队列,系统版本等信息.好的参数设置需要达到 ...
- MySQL Database on Azure 参数设置
在使用MySQL过程中,经常会根据需要对MySQL的参数进行一些设置和调整.作为PaaS版本的MySQL,MySQL Database on Azure在参数设置方面有一些限制,客户不能像使用on-p ...
- SSRS报表参数设置
一.日期时间类型的参数注意事项: 关于数据类型的选择:(只有数据类型设置为日期/时间格式,在查询的时候才会显示日期控件,提示信息一般改成汉字) 指定默认值:指定开始日期为前10天,
- Lattice 的 Framebuffer IP核使用调试笔记之IP核生成与参数设置
本文由远航路上ing 原创,转载请标明出处. 这节笔记记录IP核的生成以及参数设置. 先再IP库里下载安装Framebuffer 的ipcore 并安装完毕. 一.IP核的生成: 1.先点击IP核则右 ...
随机推荐
- TCP/IP 笔记 - 广播和本地组播
在之前第二章介绍IP寻址的时候有介绍到,IP地址有4种:单播.组播.广播.任播. 单播,客户端与服务器之间点到点连接通信: 组播,在发送者和多个接收者(如某个特定的分组)之间实现点对多点的连接通信: ...
- CSS Font文字样式
font-style: /* 文字样式 italic(倾斜) | normal */ font-weight: /* 文字是否加粗 bold | normal(正常) */ font-size: /* ...
- Struts2学习(二)———— 表单参数自动封装和参数类型自动转换
前篇文章对struts2的一个入门,重点是对struts2的架构图有一个大概的了解即可,之后的几篇文章,就是细化struts2,将struts2中的各种功能进行梳理,其实学完之后,对struts2的使 ...
- Hyperledger Fabric密码模块系列之BCCSP(三)
fabric中通过工厂模式来生成bccsp实例,进而通过bccsp的接口来提供加密.解密.签名验证以及哈希等操作. fabric的factory工厂默认返回的bccsp实例是sw(也就是所有密码操作都 ...
- 利用shell显示wordcount功能
Shell脚本编程是Linux系统最为核心的技术之一,它能够利用简单的命令来实现一些复杂的功能,同时,由于Linux提供了很多文本处理命令,如grep(grep family), tr, sed, ...
- WEB页获取串口数据
最近做一个B/S的项目,需要读取电子秤的值,之前一直没做过,也没有经验,于是在网上找到很多 大致分两种 使用ActiveX控件,JS调用MSCOMM32.dll的串口控件对串口进行控制 使用C#语言 ...
- .NET源码中的链表
.NET中自带的链表是LinkedList类,并且已经直接实现成了双向循环链表. 其节点类LinkedListNode的数据结构如下,数据项包括指示到某个链表的引用,以及左,右节点和值. public ...
- Repeater 控件的嵌套使用
Repeater 控件的嵌套使用 ItemDataBound:数据绑定的时候(正在进行时)发生,多用在Repeater控件嵌套,对子Repeater控件进行数据绑定及模板列中统计列的计算处理等 ...
- 【分布式】1、CAP原则(CAP定理)、BASE理论
CAP原则又称CAP定理,指的是在一个分布式系统中, Consistency(一致性). Availability(可用性).Partition tolerance(分区容错性),三者不可得兼. CA ...
- 设计模式-享元模式(FlyWeight)
一.概念 享元模式是对象的结构模式,它以共享的方式高效的支持大量的细粒度对象,减少对象的数量,并达到节约内存的目的. 享元对象能够做到共享的关键,主要是区分了内部状态和外部状态,内部状态是对象是在建立 ...