pyplot.subplot 及 imshow绘图 去除坐标轴及调整子图间距
来源:互联网 发布:mac做app开发 编辑:程序博客网 时间:2024/06/05 16:23
fnum = len(train_datasets)plt.figure("show pickle", figsize=(10,10))j = 0for set_filename in train_datasets: print('trying to read pickle: %s ' % set_filename) try: with open(set_filename, 'rb') as f: dataset=pickle.load(f) except Exception as e: print('Unable to open pckle file ', set_filename, ':', e) print ('%d images in total in file %s' % (len(dataset), set_filename)) for i in range(10):
plt.subplot( fnum, 10, 10*j + i + 1) plt.imshow(dataset[i], cmap='gray');
##去除子图的坐标轴, 对上一个画出的子图起作用 plt.axis('off')j += 1##设定子图间距 , left < right, top > bottom, 数字表示窗口大小的比例(如下则子图间距为窗口大小的1%) plt.subplots_adjust(left=0.04, top= 0.96, right = 0.96, bottom = 0.04, wspace = 0.01, hspace = 0.01)关于为什么要了left<right (否则会报错 ValueError: bottom cannot be >= top):
When using
subplots_adjust
, the values ofleft
,right
,bottom
andtop
are to be provided as fractions of the figure width and height. In additions, all values are measured from the left and bottom edges of the figure. This is whyright
andtop
can't be lower thanleft
andright
. A typical set-up is: ----- 点击打开参考源
阅读全文
0 0
- pyplot.subplot 及 imshow绘图 去除坐标轴及调整子图间距
- Matlab subplot 图像间距调整
- Matlab中怎么调整subplot中子图的间距
- PCA降维操作及subplot子图绘制
- matplotlib绘图实例:pyplot、pylab模块及作图参数
- matplotlib绘图实例:pyplot、pylab模块及作图参数
- matplotlib绘图实例:pyplot、pylab模块及作图参数
- matplotlib绘图实例:pyplot、pylab模块及作图参数
- matplotlib绘图实例:pyplot、pylab模块及作图参数
- matplotlib绘图实例:pyplot、pylab模块及作图参数
- matplotlib绘图实例:pyplot、pylab模块及作图参数
- 两个textarea文本框上下间距调整及inline-block间距
- 【Python数据挖掘课程】七.PCA降维操作及subplot子图绘制
- Python数据挖掘课程 七.PCA降维操作及subplot子图绘制
- matplotlib subplot 子图
- matplotlib.pyplot.subplot
- matplotlib调整子图间距,调整整体空白
- matplotlib.pyplot.imshow
- JMeter的堆大小如何设置?
- X86汇编语言(四)
- 温故java基础
- Lucene学习笔记(4)
- nginx服务器2
- pyplot.subplot 及 imshow绘图 去除坐标轴及调整子图间距
- MongoDB数据库的索引管理
- linux $问题研究
- 谈谈我对PMP的一点点感受
- 如何使用ZeroBrane Studio 调试cocos2dx-Lua代码
- wireshark抓包
- shell 简单学习2
- VM安装虚拟机踩过的坑
- 城市地图