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

Members

colorbar the colour bars of the figure: a bar per axes, or one for all when they share a range and a colour map
currentAxes the last axes of the figure, a new one when there is none
drawNow the figure drawn, resized first when a size is given
gca MATLAB’s mtexFig.gca: the axes drawn into last
mtexFigure a figure of MTEX plots: equally sized axes in a grid, with colour bars and legends that follow them
nextAxis a new axes in the next cell of the layout, the layout and the figure grown when it is full
savefig save the matplotlib figure to an image or vector-graphics file
setColormap the colour map of the plots of the figure, or of one axes
setColorRange one colour range over every axes (‘equal’), each axes its own (‘tight’), or one given as (lo, hi)
setColorScale logarithmic or linear colours on every axes of the figure
show shows the figures, matplotlib’s show
takeAxis the axes the next plot draws into: the pending one, else a new one

Used on

CrystalSymmetries

MATLAB’s mtexFigure_index

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_index_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.