a figure of MTEX plots: equally sized axes in a grid, with colour bars and legends that follow them

Syntax

fig = mtexFigure()

A new figure.

fig = mtexFigure(4, figSize='large')

Laid out for 4 axes, large.

fig = mtexFigure(layout=(1, 3))

One row of three axes.

fig = mtexFigure(6, columns=2)

6 axes in two columns.

ax = fig.nextAxis()

The next axes of the layout.

fig.children

The axes made so far.

fig.colorbar()

A colour bar per axes, or one for all.

Description

The figure becomes the current one, which gcm returns and into which the plots of MTEX draw; newMtexFigure makes one the same way.

Without layout or columns the n axes are laid out in the grid nearest to a slightly wide picture. When more axes are asked for than the layout holds, the layout grows and the figure with it, so that the axes keep their size.

The spacing is matplotlib’s constrained layout, which makes room for titles, labels and colour bars. innerPlotSpacing sets the gap between neighbouring axes, outerPlotSpacing the margin around them all, at least half that gap; both in pixels at 96 to the inch, as MATLAB’s.

Input

n the number of axes the layout is made for

Keywords

keyword default description
figSize None ‘tiny’, ‘small’, ‘medium’, ‘normal’, ‘large’, ‘huge’, or (width, height) in inches
hold False start with hold on: the next plot draws into the last axes
figure None a matplotlib figure to adopt, with its axes, instead of a new one; one embedded in a window keeps its size
columns None the number of columns of the layout
layout None (rows, columns) of the layout
innerPlotSpacing None the gap between neighbouring axes, in pixels at 96 to the inch
outerPlotSpacing None the margin around the axes, in pixels at 96 to the inch
marginx None the space left and right of every axes, in pixels at 96 to the inch
marginy None the space above and below every axes, in pixels at 96 to the inch

Output

fig mtexFigure, with fig.fig the matplotlib figure and fig.children its axes

See also

newMtexFigure, nextAxis, gcm, hold, mtexColorbar, Multiplot

Used on

CrystalSymmetries

MATLAB’s mtexFigure.mtexFigure

source

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/mtexFigure.mtexFigure_py.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.