Combined Plots

Explains how to combine several plots, e.g. plotting on the top of an inverse pole figure some important crystal directions.

On this page ...
General Principle
Combine Different EBSD Data
Combine countoured pole figures (smooth ODF plots) with EBSD Data Scatter Plots
Add Miller Indices to an Inverse Pole Figure Plot
Combining different plots in one figure

General Principle

In order to tell MATLAB to plot one plot right on the top of an older plot one has to use the commands hold all and hold hold off. Let's demonstrate this using a simple example.

plot([2 2])

hold all

plot([1 3])

hold off

Combine Different EBSD Data

First, we want to show up two different EBSD data sets in one plot

let's simulate some EBSD data

cs = crystalSymmetry('-3m');
odf = unimodalODF(orientation('euler',0,0,0,cs));
ori = calcOrientations(odf,100);
ori_rotated = calcOrientations(rotate(odf,rotation('Euler',60*degree,60*degree,0*degree)),100);

plot them as a scatter plot in axis / angle parametrized orientation space

scatter(ori)
hold all
scatter(ori_rotated);
hold off

a second way would be to superpose the pole figures of both EBSD data sets.

h = [Miller(0,0,0,1,cs),Miller(1,0,-1,0,cs)];
plotPDF(ori,h,'antipodal','MarkerSize',4)
hold all % keep plot
plotPDF(ori_rotated,h,'MarkerSize',4);
hold off % next plot command deletes all plots

Combine countoured pole figures (smooth ODF plots) with EBSD Data Scatter Plots

You can also combine a contour plot of a model ODF with a scatter plot of single orientations.

plotPDF(odf,h,'antipodal','contourf','grid')
mtexColorMap white2black
hold all
plotPDF(ori,h,'antipodal','DisplayName','EBSD 1',...
  'MarkerSize',5,'MarkerColor','b','MarkerEdgeColor','w')
hold all
plotPDF(ori_rotated,h,'DisplayName','EBSD 2',...
  'MarkerSize',5,'MarkerColor','r','MarkerEdgeColor','k');
hold off

legend('show','location','southeast')

and, of course, you can do the same with ODF plots:

plot(odf,'sections',8,'contourf','sigma')
mtexColorMap white2black
hold all
plot(ori,'MarkerSize',6,'MarkerColor','b','MarkerEdgeColor','w')
plot(ori_rotated,'MarkerSize',6,'MarkerColor','r','MarkerEdgeColor','k');
hold off

Add Miller Indices to an Inverse Pole Figure Plot

Next, we are going to add some Miller indices to an inverse pole figure plot.

plotIPDF(odf,xvector);
mtexColorMap white2black

hold all % keep plot
plot(Miller(0,0,0,1,cs),'symmetrised','labeled','backgroundColor','w')
plot(Miller(1,1,-2,0,cs),'symmetrised','labeled','backgroundColor','w')
plot(Miller(0,1,-1,0,cs),'symmetrised','labeled','backgroundColor','w')
plot(Miller(0,1,-1,1,cs),'symmetrised','labeled','backgroundColor','w')
hold off % next plot command deletes all plots

Combining different plots in one figure

The next example demonstrates how to arrange arbitrary plots into one figure

% let us import some pole figure data
mtexdata dubna

next, we compute an ODF out of them

odf = calcODF(pf)
initialize solver
start iteration
error: 7.4639E-01 5.5949E-01 3.4031E-01 1.9644E-01 1.6575E-01 1.5709E-01 1.5039E-01 1.4653E-01 1.4328E-01 1.4087E-01 1.3834E-01 
Finished PDF-ODF inversion.
error: 1.3834E-01
alpha: 7.6857E+01 7.2451E+00 1.0344E+02 9.5749E+01 4.9403E+01 6.5850E+01 1.4304E+02 
 
odf = ODF  
  crystal symmetry : Quartz (321, X||a, Y||b*, Z||c)
  specimen symmetry: 1
 
  Radially symmetric portion:
    kernel: de la Vallee Poussin, halfwidth 5°
    center: 19848 orientations, resolution: 5°
    weight: 1
 

now we want to plot the original data alongsite with the recalculated pole figures and with a difference plot

figure('position',[50 50 1200 500])

% set position 1 in a 1x3 matrix as the current plotting position
axesPos = subplot(1,3,1);

% plot pole figure 1 at this position
plot(pf({1}),'parent',axesPos)

% set position 2 in a 1x3 matrix as the current plotting position
axesPos = subplot(1,3,2);

% plot the recalculated pole figure at this position
plotPDF(odf,h{1},'antipodal','parent',axesPos)

% set position 3 in a 1x3 matrix as the current plotting position
axesPos = subplot(1,3,3);

% plot the difference pole figure at this position
plotDiff(odf,pf({1}),'parent',axesPos)
progress: 100%