当前位置:网站首页>positioner
positioner
2022-04-23 17:58:00 【Feng Ye 520】
import matplotlib.pyplot as mp
import numpy as np
mp.figure(facecolor='lightgray')
locators = [
'mp.NullLocator()',
'mp.MaxNLocator(nbins=3,steps=[1,3,5,7,9])',
'mp.FixedLocator(locs=[0,2.5,5,7.5,10])',
'mp.AutoLocator()',
'mp.IndexLocator(offset=0.5,base=1.5)',
'mp.MultipleLocator()',
'mp.LinearLocator(numticks=6)',
'mp.LogLocator(base=2,subs=[1.0])'
]
n_locators = len(locators)
for i, locator in enumerate(locators):
mp.subplot(n_locators, 1, i + 1)
mp.xlim(0, 10)
mp.ylim(-1, 1)
mp.yticks(())
ax = mp.gca()
ax.spines['left'].set_color('none')
ax.spines['top'].set_color('none')
ax.spines['right'].set_color('none')
ax.spines['bottom'].set_position(('data', 0))
ax.xaxis.set_major_locator(eval(locator))
ax.xaxis.set_minor_locator(mp.MultipleLocator(0.1))
mp.plot(np.arange(11), np.zeros(11), c='none')
mp.text(5, 0.3, locator[3:], ha='center', size=12)
mp.tight_layout()
mp.show()
# Running results :
版权声明
本文为[Feng Ye 520]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230546134331.html
边栏推荐
- 列錶的使用-增删改查
- Qtablewidget usage explanation
- MySQL advanced index [classification, performance analysis, use, design principles]
- C# 的数据流加密与解密
- Tell the truth of TS
- Examination question bank and online simulation examination of the third batch (main person in charge) of special operation certificate of safety officer a certificate in Guangdong Province in 2022
- Romance in C language
- Go对文件操作
- SystemVerilog(六)-变量
- Use of list - addition, deletion, modification and query
猜你喜欢
2022年上海市安全员C证操作证考试题库及模拟考试
Go file operation
2021 Great Wall Cup WP
MySQL 中的字符串函数
开源按键组件Multi_Button的使用,含测试工程
Applet learning notes (I)
Anchor location - how to set the distance between the anchor and the top of the page. The anchor is located and offset from the top
MySQL进阶学习之SQL优化【插入,主键,排序,分组,分页,计数】
Future usage details
C#的随机数生成
随机推荐
Nanotechnology + AI enabled proteomics | Luomi life technology completed nearly ten million US dollars of financing
2022年流动式起重机司机国家题库模拟考试平台操作
Submit local warehouse and synchronize code cloud warehouse
2022 tea artist (primary) examination simulated 100 questions and simulated examination
Commonly used functions -- spineros:: and spineros::)
2022年茶艺师(初级)考试模拟100题及模拟考试
587. 安装栅栏 / 剑指 Offer II 014. 字符串中的变位词
Amount input box, used for recharge and withdrawal
Summary of floating point double precision, single precision and half precision knowledge
Applet learning notes (I)
.104History
Tensorflow tensor introduction
JS get link? The following parameter name or value, according to the URL? Judge the parameters after
C language loop structure program
Timestamp to formatted date
干货 | 快速抽取缩略图是怎么练成的?
31. Next arrangement
Remember using Ali Font Icon Library for the first time
I / O multiplexing and its related details
MySQL_01_简单数据检索