mtexLayout.solveLayout edit page

where every axes, colorbar and legend goes, as arithmetic

Description

The whole layout is one function: n axes of equal size and equal aspect ratio on a grid, each wrapped in a decoration band, the grid wrapped in an outer band that also holds a global colorbar, an outside legend and an sgtitle. No graphics handle goes in and none comes out, so this runs - and is tested - without a figure.

Either the figure size is given and the axes size follows, or fixedAxisHeight is given and plan.figSize says how big the figure has to grow for it to fit.

spec fields, all in pixels, all optional but n

n               - number of axes
ratio           - height/width one axes should be shaped with
inset           - n x 4 or 1 x 4 decoration band [l b r t] per axes
figInset        - 1 x 4 outer band
spacing         - gap between neighbouring axes
figSize         - [w h] available
keepAspectRatio - shape the axes by ratio rather than filling
fixedAxisHeight - force this height and grow the figure instead
layoutMode      - 'auto' to choose the grid, 'user' to be told it
ncols, nrows    - the grid, when layoutMode is 'user'
plotBox         - where an axes draws in its rectangle, as fractions of it
cBar            - .n (0, 1 or n), .side, .thickness, .gap, .labelRoom, .drop
legend          - .size [w h], .side, .spacing

plan fields

ncols, nrows    - the grid it settled on
axisWidth/Height- size of one axes
pos             - n x 4, where the axes go
cBarPos         - 0, 1 or n rows
legendPos       - 1 x 4, or empty
inset, figInset - the bands after the colorbar and legend were reserved
figSize         - the size the figure needs to hold all of it

Syntax

plan = mtexLayout.solveLayout(spec)

Input

spec what was measured off the figure, see below

Output

plan where everything goes, in pixels

See also

mtexLayout mtexFigure.drawNow

Citing this page. This page is part of the documentation of MTEX, a free and open source MATLAB toolbox for analyzing and modeling crystallographic textures. It was written by The MTEX Developers and is published at https://mtex-toolbox.github.io/mtexLayout.solveLayout.html. If you use MTEX, or reuse text or figures from this page, in your research, please cite

F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63

BibTeX
@article{bachmann2010mtex,
  author  = {F. Bachmann and R. Hielscher and H. Schaeben},
  title   = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
  journal = {Solid State Phenomena},
  volume  = {160},
  pages   = {63-68},
  year    = {2010},
  doi     = {10.4028/www.scientific.net/SSP.160.63},
  url     = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}

Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.