python histo 改变 bins 大小_子批次大小python
我目前面临的问题可以从图片
左下角的Y轴很大,从-100到+600。有办法修改吗?我试了很多次都没找到。在# 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')
现在我可以使用:axScatter.set yu ylim公司(-5,5)
缩小轴,但接下来会发生这种情况:
这是一个转贴,因为不知何故删除了所有的评论。。。在
python histo 改变 bins 大小_子批次大小python相关推荐
- python histo 改变 bins 大小_在Python中显示具有非常不均匀的bin宽度的直方图
这是直方图 为了生成这个图,我做了: bins = np.array([0.03, 0.3, 2, 100]) plt.hist(m, bins = bins, weights=np.zeros_li ...
- python不改变图片尺寸压缩到指定大小
python不改变图片尺寸压缩到指定大小 import base64 import io import os from PIL import Image from PIL import ImageFi ...
- python不改变图片尺寸压缩到指定大小 1
python不改变图片尺寸压缩到指定大小 import base64 import io import os from PIL import Image from PIL import ImageFi ...
- Python 图像 一样大小_#带你学Python# 表白利器:用Python发微信表情画-带你认识图片的秘密...
首先感谢大家对上篇文章"python实现传染病模型"的肯定: 孙小白:#带你学Python# 疫情当前,在家没事?你也可以用Python预测疫情发展zhuanlan.zhihu. ...
- python tkinter 表格 怎么设置字体大小_更改字体大小而不影响Tkinter按钮大小
我找到了这个问题的解决办法.我试图解决一个类似的问题:我想把图像贴上标签.我将图像大小设置为标签大小.当我试图用命令label.config(image=img)放置它时,标签大小会增大.图像的大小是 ...
- python程序不出结果_超详细的Python入门教程,1小时就可以学会
为什么使用Python 假设我们有这么一项任务:简单测试局域网中的电脑是否连通.这些电脑的ip范围从192.168.0.101到192.168.0.200. 思路:用shell编程.(Linux通常是 ...
- 趣学python教孩子学编程_《趣学Python——教孩子学编程》学习笔记第1-3章
第1章 Python不是大蟒蛇 1.1 关于计算机语言 计算机程序是一组让计算机执行某种动作的指令.软件就是计算机程序的集合. 一种编程语言就是一种特定的与计算机交谈的方式,这种方式使用计算机和人都能 ...
- python 鱼c工作室作业_#鱼C工作室Python作业#图解python百度云
最好的python视频教程谁有 我这里有python全套高清教学视频,非常适合新手小白,真实分享,望采纳点赞. python 网盘 python视频教程从入门到精通 有提取码:提取码:8ste 求一个 ...
- python从外部传入参数_从另一个Python脚本运行一个Python脚本,并传入参数 - python...
我想从另一个Python脚本运行一个Python脚本.我想像使用命令行一样传递变量. 例如,我将运行我的第一个脚本,该脚本将遍历值列表(0.1.2.3),并将其传递给第二个脚本,依次为script2. ...
最新文章
- numpy库学习 向量 矩阵 均为有两个[[ ,而秩为1的数组只有一个[ np.array([[]]) 与np.array([])的区别
- 机器学习新手们 我这有本秘笈要不要?
- Android 打印log 在logcat 看不到
- 深度揭秘!蚂蚁业务自定义监控大盘是怎么设计的?
- HttpHandler
- 【小程序】【Tips】image 组件中 null 和 undefined 的区别和对策
- 第一章信息安全基础考试要点及真题分布
- 压测学习总结(3)——Jmeter 脚本如何生成
- 知名互联网公司系统架构图[第3期]
- jrebel离线激活_jrebel激活
- C++实现的一个加密文件的程序
- linux seek原理,Linux内核:seek机制
- 网易云音乐用户微观洞察精细化运营
- 数据库常见问题:服务器'SQL SERVER'上的 MSDTC 不可用
- 中国魔笛痛改前非做好准备 国足不能失去传奇大师
- js实现3D旋转相册
- 论文阅读 || 目标检测系列 —— RCNN详解
- spring中的JdbcTemplate的使用方法
- 我心中的程序设计新时代
- net usershare 返回错误 255
热门文章
- 太阳的光和灯光有什么区别_墙体彩绘机UV(油性)和水性墨水怎么选择?有什么区别?...
- BUUCTF(pwn)[HarekazeCTF2019]baby_rop
- Python基础教程:list深拷贝和浅拷贝
- Python高级数据类型模块collections
- python logging模块写入中文,文件乱码的解决方法
- 使用sphinx为python注释生成docAPI文档
- 2020年电大c语言程序设计作业1答案,2019年最新电大C语言程序设计作业答案.doc
- linux c语言中如何通过进程名获取进程PID(awk命令行指令)popen、pclose
- 什么是故事板?(故事图、Storyboard)(软件显示效果的视觉草图,用于视频创作和广告设计,表达作者的创意)
- 什么是尾递归?测试python尾递归