日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > python >内容正文

python

python histo 改变 bins 大小_子批次大小python

發(fā)布時(shí)間:2025/3/19 python 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python histo 改变 bins 大小_子批次大小python 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

我目前面臨的問(wèn)題可以從圖片

左下角的Y軸很大,從-100到+600。有辦法修改嗎?我試了很多次都沒(méi)找到。在# the random data

x = np.random.randint(0,500,100000)

y = np.random.randn(100000)

fig = plt.figure(1, figsize=(5.5,5.5))

from mpl_toolkits.axes_grid1 import make_axes_locatable

# the scatter plot:

axScatter = plt.subplot(111)

axScatter.scatter(x, y)

axScatter.set_aspect(1.)

# create new axes on the right and on the top of the current axes

# The first argument of the new_vertical(new_horizontal) method is

# the height (width) of the axes to be created in inches.

divider = make_axes_locatable(axScatter)

axHistx = divider.append_axes("top", 1.2, pad=0.1, sharex=axScatter)

axHisty = divider.append_axes("right", 1.2, pad=0.1, sharey=axScatter)

# make some labels invisible

plt.setp(axHistx.get_xticklabels() + axHisty.get_yticklabels(),

visible=False)

# now determine nice limits by hand:

binwidth = 0.25

print np.max(np.fabs(y))

print np.max(np.fabs(x))

xymax = np.max( [np.max(np.fabs(x)), np.max(np.fabs(y))] )

print xymax #will always be gene length wich should not be

lim = ( int(xymax/binwidth) + 1) * binwidth

print lim

bins = np.arange(0, lim + binwidth, binwidth)

print bins

#two histo grams, should stay of this?

axHistx.hist(x, bins=bins)

axHisty.hist(y, bins=bins, orientation='horizontal')

# the xaxis of axHistx and yaxis of axHisty are shared with axScatter,

# thus there is no need to manually adjust the xlim and ylim of these

# axis.

#axHistx.axis["bottom"].major_ticklabels.set_visible(False)

for tl in axHistx.get_xticklabels():

tl.set_visible(False)

axHistx.set_yticks([0, 50, 100,200])

#axHisty.axis["left"].major_ticklabels.set_visible(False)

for tl in axHisty.get_yticklabels():

tl.set_visible(False)

axHisty.set_xticks([0, 50000, 100000])

plt.draw()

plt.show()

plt.savefig('.png')

現(xiàn)在我可以使用:axScatter.set yu ylim公司(-5,5)

縮小軸,但接下來(lái)會(huì)發(fā)生這種情況:

這是一個(gè)轉(zhuǎn)貼,因?yàn)椴恢喂蕜h除了所有的評(píng)論。。。在

總結(jié)

以上是生活随笔為你收集整理的python histo 改变 bins 大小_子批次大小python的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。