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核则右 ...
随机推荐
- Docker应用场景
Docker的应用场景 Web 应用的自动化打包和发布. 自动化测试和持续集成.发布. 在服务型环境中部署和调整数据库或其他的后台应用. 从头编译或者扩展现有的OpenShift或Cloud Foun ...
- SpringBoot初体验及原理解析
一.前言 上篇文章,我们聊到了SpringBoot得以实现的幕后推手,这次我们来用SpringBoot开始HelloWorld之旅.SpringBoot是Spring框架对“约定大于配置(Conv ...
- Kafka实战-数据持久化
1.概述 经过前面Kafka实战系列的学习,我们通过学习<Kafka实战-入门>了解Kafka的应用场景和基本原理,<Kafka实战-Kafka Cluster>一文给大家分享 ...
- 如何将打包好的文件做成一个APP
本文主要是用来简短的对做成一个APP进行说明,内容可能不是多详细,但会给出具体思路.(仅供参考) 因为各种打包和生成APP的方式多样,今天这里仅仅对用Hbuilder打包进行说明. 1.首先当然需要一 ...
- Java第三方支付接入案例(支付宝)
开源项目链接 Kitty 开源权限管理系统 项目地址:https://gitee.com/liuge1988/kitty 演示地址:http://139.196.87.48:9002/kitty 用户 ...
- 关系型数据库 VS NOSQL
转载:https://mp.weixin.qq.com/s/FkoOMY8_vnqSPPTHc2PL1w 行式数据库(关系型数据库) 行式数据库有如下几个缺点: 大数据场景下 I/O 较高,因为数据是 ...
- leetcode — substring-with-concatenation-of-all-words
import java.util.*; /** * Source : https://oj.leetcode.com/problems/substring-with-concatenation-of- ...
- Xdebug在PHP中的安装配置
Xdebug在PHP中的安装配置涉及php.ini配置文件的修改. 1 首先需要下载Xdebug,根据安装的PHP版本,选择合适的Xdebug版本, 2 安装Xdebug将下载的php_xdebu ...
- python取余
a=-7,b=3, a % b = 2 #取余 a-((a/b)*b) a / b= -3 #整除 int(math.floor(-7/3.0))
- activeX
对外接口和classid在idl文件中,接口功能实现在ctrl类中实现