Plotting edit page

This section gives you an overview of the functionality MTEX offers to visualize spatial orientation data. Let us first import some sample EBSD data.

close all; plotx2east
mtexdata forsterite
csFo = ebsd('Forsterite').CS;
ebsd = EBSD
 Phase  Orientations     Mineral         Color  Symmetry  Crystal reference frame
     0   58485 (24%)  notIndexed                                                 
     1  152345 (62%)  Forsterite  LightSkyBlue       mmm                         
     2   26058 (11%)   Enstatite  DarkSeaGreen       mmm                         
     3   9064 (3.7%)    Diopside     Goldenrod     12/m1       X||a*, Y||b*, Z||c
 Properties: bands, bc, bs, error, mad, x, y
 Scan unit : um

Phase Plots

By default, MTEX plots a phase map for EBSD data.


You can access the color of each phase by

ans =
    0.8549    0.6471    0.1255

These values are RGB values which can be altered to any other RGB triple. A more convinient way for changing the color is the function str2rgb which converts color names into RGB triplets

ebsd('Diopside').color = str2rgb('salmon');


By default, not indexed phases are plotted as white and it is impossible to assign a different color as we did it for real phases. Instead we need to use option FaceColor to specify the color directly in the plotting command.

hold on
hold off

Visualizing arbitrary properties

Apart from the phase information, we can use any other property to colorize the EBSD data. As an example, we may plot the band contrast


colormap gray % make the image grayscale

Visualizing orientations

Actually, we can pass any list of numbers or colors as a second input argument to be visualized together with the ebsd data. In order to visualize orientations in an EBSD map, we have first to compute a color for each orientation. The most simple way is to assign to each orientation its rotational angle. This is done by the command


Obviously, the rotational angle is not a very distintive representative for orientations. A more common approach is to define a colorization of the fundamental secor of the inverse pole figure, a so called ipf color key, and to colorize orientations according to their position in a fixed inverse pole figure. Let's consider the following standard key.

% this defines an ipf color key for the Forsterite phase
ipfKey = ipfColorKey(ebsd('Forsterite'));
ipfKey.inversePoleFigureDirection = vector3d.Z;

% this is the colored fundamental sector

Next we may utilize this key to turn the orientations into colors, which are than passed to the plot command.

colors = ipfKey.orientation2color(ebsd('Forsterite').orientations);

The above ipf color key can be largely customizied. This is explained in more detail in IPF Maps. Beside IPF maps there are also more specific ways to colorize orientations as they are discussed in Advanced Plotting.

Superposing different plots

Combining different plots can be done either by plotting only subsets of the EBSD data or via the option 'faceAlpha'. Note that the option 'faceAlpha' requires the renderer of the figure to be set to 'opengl'.

close all;
mtexColorMap black2white

hold on
hold off