久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

matplotlib如何實(shí)現(xiàn)scale刻度

153次閱讀
沒有評論

共計(jì) 1333 個(gè)字符,預(yù)計(jì)需要花費(fèi) 4 分鐘才能閱讀完成。

這篇文章主要介紹 matplotlib 如何實(shí)現(xiàn) scale 刻度,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

1.5. 對數(shù)或者其他非線性坐標(biāo)軸
使用 plt.xscal() 來改變坐標(biāo)軸的刻度

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter # useful for `logit` scale# Fixing random state for reproducibilitynp.random.seed(19680801)# make up some data in the interval ]0, 1[y = np.random.normal(loc=0.5, scale=0.4, size=1000)
y = y[(y   0)   (y   1)]
y.sort()
x = np.arange(len(y))# plot with various axes scalesplt.figure(1)# linearplt.subplot(221)
plt.plot(x, y)
plt.yscale(linear)
plt.title(linear)
plt.grid(True)# logplt.subplot(222)
plt.plot(x, y)
plt.yscale(log)
plt.title(log)
plt.grid(True)# symmetric logplt.subplot(223)
plt.plot(x, y - y.mean())
plt.yscale(symlog , linthreshy=0.01)
plt.title(symlog)
plt.grid(True)# logitplt.subplot(224)
plt.plot(x, y)
plt.yscale(logit)
plt.title(logit)
plt.grid(True)# Format the minor tick labels of the y-axis into empty strings with# `NullFormatter`, to avoid cumbering the axis with too many labels.plt.gca().yaxis.set_minor_formatter(NullFormatter())# Adjust the subplot layout, because the logit one may take more space# than usual, due to y-tick labels like  1 - 10^{-3} plt.subplots_adjust(top=0.92, bottom=0.08, left=0.10, right=0.95, hspace=0.25,
wspace=0.35)
plt.show()

以上是“matplotlib 如何實(shí)現(xiàn) scale 刻度”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注丸趣 TV 行業(yè)資訊頻道!

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2023-08-25發(fā)表,共計(jì)1333字。
轉(zhuǎn)載說明:除特殊說明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 城固县| 临漳县| 理塘县| 诸城市| 墨竹工卡县| 三明市| 韶关市| 高州市| 扶余县| 庆城县| 大余县| 金坛市| 拉萨市| 和硕县| 香港| 昌吉市| 通江县| 陆良县| 茂名市| 平南县| 运城市| 肇源县| 定西市| 屏边| 原阳县| 津市市| 二手房| 当涂县| 宣汉县| 蒙自县| 稻城县| 泗水县| 新和县| 克什克腾旗| 手机| 延川县| 玉龙| 达孜县| 孝昌县| 成安县| 易门县|