

And, of course, it conveniently returns a vector of handles to.

Please continue to steer us to your favorite File Exchange submissions. Make the most use of the matlab default figure set, adjust the position of the axes of subplot, remove white space,make figure tight. The syntax is easy to use: ha tightsubplot (Nh, Nw, gap, margh, margw) allows me to specify the number of horizontal axes, the number of vertical axes, the gap as a scalar (or as a vector of horizontal and vertical gap values, gaph gapw), and the height and width margins. (again!) to Frank Engel for the nomination. Pekka's function affords great control beyond just making a tight array of subplots. Type p1 plot (x, sin (x), ‘g-’) and press Enter. It tells MATLAB to place the first plot in the first space in the grid. This function creates a grid consisting of one row and three columns. Ha = tight_subplot(2,2,0.05,) Ĭreates a 2x2 array of axes with a normalized horizontal gap of 0.05 a vertical gap of 0.025 an equal height margin (topĪnd bottom) of 0.05 and unequal width margins-0.3 on the left, and 0.05 on the right. MATLAB clears any previous plot you created. And, of course, it conveniently returns a vectorīy default, the axes spacing is tighter than subplot's:Īnd you can clearly see how the function got its name.īetter still, ask tight_subplot for custom spacing: figure % ha = tight_subplot(Nh, Nw, gap, marg_h, marg_w)Īllows me to specify the number of horizontal axes, the number of vertical axes, the gap as a scalar (or as a vector of horizontalĪnd vertical gap values, ), and the height and width margins. "Tight Subplot" is not that the default axes spacing makes better use of the figure's real estate, but that it gives me complete-andĮasy-control over horizontal and vertical gap spacing, and separately, of left-and-right and top-and-bottom margin spacing. Name-Value Arguments Specify optional pairs of arguments as Name1Value1. Fair enough (though with a bit of effort, one can customize the position of subplots). Subplot grid container, specified as a Figure, Panel, or Tab object. (default) gaps between axes generated with the subplot command. Judging from the title of the submission, Pekka wrote and shared "Tight Subplot" because he was dissatisfied with the large

Brett's Pick this week is the Tight Subplot, by Pekka Kumpulainen.
