当前位置:网站首页>定位器
定位器
2022-04-23 05:47:00 【峰爷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()
#运行结果:
版权声明
本文为[峰爷520]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_41752427/article/details/81166024
边栏推荐
- C3p0 database connection pool usage
- IO multiplexing of 09 redis
- Type conversion in C #
- 8. Integer Decomposition
- The onnx model of yolov5 removes the transfer layer
- Framework analysis 1 Introduction to system architecture
- 卡尔曼滤波与惯性组合导航
- Pytorch notes - get familiar with the network construction method by building RESNET (complete code)
- Event listener
- Common programming records - parser = argparse ArgumentParser()
猜你喜欢
Reading of denoising papers - [cvpr2022] blind2blind: self supervised image denoising with visible blind spots
Denoising paper - [noise2void, cvpr19] noise2void learning denoising from single noise images
从源代码到可执行文件的过程
Comparative study paper - [Moco, cvpr2020] momentum contract for unsupervised visual representation learning
Guaba and Computational Geometry
Robocode教程3——Robo机器剖析
Unsupervised denoising - [tmi2022] ISCL: dependent self cooperative learning for unpaired image denoising
C language file operation
Kibana search syntax
[leetcode 19] delete the penultimate node of the linked list
随机推荐
Consistent hash algorithm used for redis cache load balancing
The bottom implementation principle of thread - static agent mode
Pytorch notes - get familiar with the network construction method by building RESNET (complete code)
9.Life, the Universe, and Everything
[leetcode169] most elements
A sharp tool to improve work efficiency
How SYSTEMd uses / etc / init D script
程序設計訓練
Unsupervised denoising - [tmi2022] ISCL: dependent self cooperative learning for unpaired image denoising
[leetcode 59] spiral matrix II
Generate excel template (drop-down selection, multi-level linkage)
ThreadLocal. Threadlocalmap analysis
Cf515b drazil and his happy friends
Custom exception class
[leetcode 67] sum of two binary numbers
1. Calculate a + B
Miscellaneous 1
[leetcode 19] delete the penultimate node of the linked list
Integers have friends interval GCD + double pointer
The onnx model of yolov5 removes the transfer layer