Here we describe how to visualize grain boundary properties, e.g., misorientation angle, misorientation axes. Therefore lets start by importing some EBSD data and reconstructing the grain structure.
close all;
% import the data
plottingConvention.default('y↑→x');
mtexdata forsterite silent
% restrict it to a sub-region of interest.
ebsd = ebsd(inpolygon(ebsd,[5 2 10 5]*10^3));
% reconstruct grains
[grains,ebsd] = calcGrains(ebsd,'minPixel',5,'alpha',10);
% smooth the grains a bit - ebsdId is read per segment further down, so keep
% every segment between the pair of pixels it was measured from
grains = smoothBoundary(grains,4,'noSimplify','noRefine')grains = grain2d (y↑→x)
Phase Grains Pixels Mineral Symmetry Color
1 52 14016 Forsterite mmm LightSkyBlue
2 13 1375 Enstatite mmm DarkSeaGreen
3 21 693 Diopside 12/m1 Goldenrod
boundary segments: 3288 (141261 µm)
inner boundary segments: 12 (464 µm)
triple points: 122
Properties: meanRotation, GOSThe grain boundary segments of a list of grains are stored within the field
gB = grains.boundarygB = grainBoundary (y↑→x)
Segments length mineral 1 mineral 2
489 27814 µm notIndexed Forsterite
25 1615 µm notIndexed Enstatite
24 1396 µm notIndexed Diopside
1385 55477 µm Forsterite Forsterite
653 26296 µm Forsterite Enstatite
520 20622 µm Forsterite Diopside
35 1296 µm Enstatite Enstatite
134 5794 µm Enstatite Diopside
23 951 µm Diopside DiopsideWe may use the plot command to visualize the grain boundaries in the map
% plot phases and grain boundaries
plot(ebsd)
hold on
plot(gB,'lineWidth',2)
hold off
Specific boundaries
Accordingly, we can access the grain boundary of a specific grain by
grains(47).boundary
% lets highlight this specific grain by its boundary
hold on
plot(grains(47).boundary,'lineWidth',4,'lineColor','DarkBlue')
hold offans = grainBoundary (y↑→x)
Segments length mineral 1 mineral 2
29 1084 µm Forsterite Diopside
4 305 µm Enstatite Diopside
For a multi-phase system, the location of specific phase transitions may be of interest. The following plot highlights all Forsterite to Enstatite phase transitions
hold on
plot(grains.boundary('Fo','En'),'linecolor','DarkGreen','linewidth',4)
hold off
Another type of boundaries is boundaries between measurements that belong to the same grain. This happens if a grain has a texture gradient that loops around these two measurements.
hold on
plot(grains.innerBoundary,'linecolor','red','linewidth',4)
hold off
Misorientation angle
The boundary misorientation is the misorientation between the two neighboring pixels of a boundary segment. Depending of the misorientation angle one distinguishes between high angle and low angle grain boundaries. In MTEX we can visualize the boundary misorientation angle by the commands
close all
gB_Fo = grains.boundary('Fo','Fo');
plot(grains,'translucent',1,'micronbar','off')
legend off
hold on
plot(gB_Fo,gB_Fo.misorientation.angle./degree,'linewidth',4)
hold off
mtexColorbar('title','misorientation angle')
The misorientation axes in crystal coordinates
Similarly as the rotational angle we may colorize the grain boundaries also according the misorientation axes. First of all we have to decide whether we want to visualize the rotational axis in crystal or coordinate system. Second we have to define a color key that translates rotational axes into colors.
Lets start with the rotational axes in crystal coordinates
% computed the axes in specimen coordinates
axes = gB_Fo.misorientation.axis
% define a color key
colorKey = HSVDirectionKey(axes);
% compute colors
color = colorKey.direction2color(axes);
hold on
plot(gB_Fo,'lineColor','black','linewidth',6) % some black background for contrast
plot(gB_Fo,color,'linewidth',4)
hold off
mtexColorbar('visible','off')axes = Miller (Forsterite)
size: 1385 x 1
As a colorbar replacement we plot the color key and on top of it the misorientation axes at the grain boundaries
figure(2)
plot(colorKey)
hold on
plot(axes,'MarkerFaceAlpha',0.1,'MarkerEdgeAlpha',0.3,'MarkerColor','black')
hold off
The misorientation axes in specimen coordinates
Analyzing the misorientation axis in specimen coordinates is a bit more involved as it requires to extract the two neighboring orientations to each boundary segment. To do this we use the ebsdId stored in the boundary segments.
figure(1)
% first we reduce the number of boundary segments a bit
% in order to avoid that the plot becomes to messy
gB_red = reduce(gB_Fo,5)
% next we extract for every boundary segment the two orientations at both
% sides
ori = ebsd('id',gB_red.ebsdId).orientations
% the two orientations we use to compute the misorientation axis in
% specimen coordinates
axes = axis(ori(:,1),ori(:,2))
% plot the projection of the misorientation axis on the measurement surface
hold on
quiver(gB_red,axes,'autoScaleFactor',0.4,'color','black')
hold offgB_red = grainBoundary (y↑→x)
Segments length mineral 1 mineral 2
338 53654 µm Forsterite Forsterite
ori = orientation (Forsterite → y↑→x)
size: 338 x 2
axes = vector3d (y↑→x)
size: 338 x 1
Full Misorientation Colorization
In order to visualize the full misorientation, i.e., axis and angle, one has to define a corresponding color key. One option is the color key described in the paper by S. Patala, J. K. Mason, and C. A. Schuh, Improved representations of misorientation information for grain boundary, Prog. Mater. Sci., vol. 57, no. 8, pp. 1383-1425, 2012.
% plot the grains
close all
plot(grains,'micronbar','off')
legend off
% define the color key
colorKey = PatalaColorKey(gB_Fo);
hold on
plot(gB_Fo,'linewidth',7)
hold on
color = colorKey.orientation2color(gB_Fo.misorientation);
plot(gB_Fo,squeeze(color),'linewidth',4)
hold off
Lets visualize the color key as axis angle sections through the misorientation space
figure(2)
plot(colorKey,'layout',[3,4])
% and plot the misorientations on top
plot(gB_Fo.misorientation,...
'MarkerFacecolor','none','add2all','MarkerSize',4)
Lets illustrate this color coding also at a iron sample.
% import the data
plottingConvention.default("y↓→x");
mtexdata csl
% grain segmentation and smoothing
[grains,ebsd] = calcGrains(ebsd);
grains = smoothBoundary(grains,2);
gB = grains.boundary('iron','iron');
% and plot image quality + orientation
close all
plot(ebsd,log(ebsd.prop.iq),'figSize','large')
mtexColorMap black2white
setColorRange([.5,5])
hold on
plot(grains,grains.meanOrientation,'FaceAlpha',0.4)
% define the color key and colorize the grain boundaries
colorKey = PatalaColorKey(gB)
color = colorKey.orientation2color(gB.misorientation);
hold on
plot(gB,squeeze(color),'linewidth',4,'smooth')
hold offebsd = EBSD (y↓→x)
Phase Orientations Mineral Color Symmetry Crystal reference frame
0 5 (0.0032%) notIndexed none
-1 154107 (100%) iron LightSkyBlue m-3m
Properties: ci, error, iq
Scan unit : um
X x Y x Z : [0 → 511] x [0 → 300] x [0 → 0]
Normal vector: (0,0,1)
colorKey = PatalaColorKey (iron → iron)
antipodal: true
At the end we plot the colorized misorientation space in axis angle sections. Note that in this plot misorientations mori and inv(mori) are associated.
plot(colorKey,'axisAngle',(5:5:60)*degree,'layout',[3,4])
plot(gB.misorientation,'points',300,'add2all',...
'MarkerFaceColor','none','MarkerEdgeColor','w')plotting 300 random orientations out of 17569 given orientations
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/BoundaryPlots.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.