MATLAB中subplot绘图相关技巧
来源:互联网 发布:淘宝买到假货如何投诉 编辑:程序博客网 时间:2024/06/08 00:27
http://xiaotingzi.blog.163.com/blog/static/217769214201361981535727/
The first thing I want to mention is that tightfig has a different purpose than the other entries. The description on the entry page explains the purpose very well: "Alters a figure so that it has the minimum size necessary to enclose all axes in the figure without excess space around them." Note that this is about making the outer bounds of the figure tight. Its intention is not to modify any of the spacings between the axes, which is the primary purpose of the other entries. I'll say more on this later.
tightfig is extremely simple to use. You just call it after creating your plots, and it applies to the current figure. That's one of my favorite things about this entry.Review of the other entries
Before looking into the other entries, I'd like to point out that the use case for tightfig is quite different from that of the others. One is for tightening the figure boundary, and the others are for controlling/tightening the axes boundaries. So it may not be an apples-to-apples comparison. Nonetheless, here I go. Oh, and try not to get confused with all the names. :)
subplot_tight
I find subplot_tight to be the easiest to use, since it has a syntax that is closest to the MATLAB functionsubplot. Not surprisingly, it is a wrapper around subplot, with an added option to specify the spacing between an axes and its neighbors. Because it's a wrapper, you can make use of the vector input syntax for the 3rd parameter (see below). The author also supplies a demo script to recreate his screenshot.
tight_subplot and subplot1
tight_subplot and subplot1 are quite similar. They both allow you to lay out a grid of subplots with arbitrary spacings and margins. tight_subplot is compact with just those parameters, i.e. spacing and margin, whilesubplot1 lets you control other axes properties, such as tick labels, label font size, and axes scale. I like that it gives me the ability to have the tick labels only displayed on the outside with subplot1 (see example below).
spaceplots
spaceplots works like tightfig, in that you create your figure first with subplots, then call spaceplots to adjust the spacings and margins. This function, unlike tightfig, will allow you to adjust the spacings between axes, not just the outside margin. The part that I like most is that it will work with irregular-grid subplots (see example below). However, there's a caveat that it only works on axes created using subplot.
subplotplus
subplotplus is the king of custom subplots. It comes with a price of somewhat cryptic syntax, but once you understand it (with the help of an example script), it can let you custom layout your subplots in any configuration you like. It even includes the ability to "glue" axes together so that they have a common axis.
Conclusion
So what have I concluded from this review? There are multiple solutions to a problem! They all have unique ways of tackling the problem, and some solve a slightly different problem than others. Overall, I prefer the "post-processing" type functions, tightfig and spaceplots. I tend to do my exploratory plotting in a rough state, and once I have a plot I like, then I start making things look nicer. But of course, with an interactive tool like MATLAB, even the "pre-processing" type functions can be introduced at a later step.
- MATLAB中subplot绘图相关技巧
- MATLAB中subplot的用法
- MATLAB中subplot的用法
- MATLAB中subplot的用法
- Matlab-------------subplot函数(一个窗口多个绘图)
- Opencv 中类似matlab的subplot功能
- matlab中subplot函数的功能
- MATLAB绘图相关
- Matlab绘图相关
- Matlab绘图技巧
- MATLAB实用绘图技巧
- Matlab中控制图像显示边界,subplot间距等
- Matlab中怎么调整subplot中子图的间距
- Matlab中多图显示(subplot)
- matlab中的subplot函数
- subplot函数用法(MATLAB)
- matlab subplot 3
- matlab subplot函数用法
- verilog-ise中BUFG和IBUFG的使用
- java的ClassLoader简介
- java程序猿不得不知的充电网站
- spring-shiro外篇记住我功能
- find、grep、sed小命令
- MATLAB中subplot绘图相关技巧
- 黑客工具包ShadowBrokers浅析
- 数据库
- 1047. 编程团体赛(20)
- 提高你的Java代码质量吧:提倡异常封装
- Shadowsocks服务器安装Python版
- Android代码设置Shape,corners,Gradient
- MySQL第三章如何存储和获取数据
- Dubbo入门---搭建一个最简单的Demo框架