%
% Example of mapping grain boundaries and phase boundaries
% of rock composed of Forsterite, Enstatite and Diopside
%
% Using MTEX data set forsterite
%
% David Mainprice 9/02/2017
%
% Uses proper rotations of Laue class 'mmm' in this case point group '222'
%
%**************************************************************************
%% Clear memory and close all plots
clear all
close all
%% import MTEX example data set
mtexdata forsterite
%
% correct EBSD spatial coordinates
%
% rotate only the spatial data about the z-axis
ebsd = rotate(ebsd,180*degree,'keepEuler');
% rotate only the spatial data about the y-axis
ebsd = rotate(ebsd,rotation('axis',yvector,'angle',180*degree),'keepEuler');
% plot X to East
plotx2east;
% *** Crystallographic a-axes to East ***
plota2east;
% Font Size
setMTEXpref('FontSize',25);
% cycle through all indexed phases an set the symmetry group to the largest
% proper subgroup of the Laue group
fprintf(' \n')
fprintf(' *****************************************************\n')
fprintf(' *Crystal Symmetery re-set to rotational point groups*\n')
fprintf(' *****************************************************\n')
fprintf(' \n')
for i = ebsd.indexedPhasesId
  ebsd.CSList{i} = ebsd.CSList{i}.properGroup;
end
display(ebsd)
%**************************************************************************
%% Grain modelling prototcole - using indexed points and segmentation angle
% and re-calculate grain model to cleanup grain boundaries
%**************************************************************************
% segmentation angle typically 10 to 15 degrees
seg_angle = 10;
% minimum indexed points per grain between 5 and 10
min_points = 10;
% Restrict to indexed only points
[grains,ebsd.grainId,ebsd.mis2mean] = calcGrains(ebsd('indexed'),'angle',seg_angle*degree);
% Remove small grains with less than min_points indexed points 
grains = grains(grains.grainSize > min_points);
% Re-calculate grain model to cleanup grain boundaries with less than minimum index points 
% used ebsd points within grains having the minium indexed number of points (e.g. 10 points)
ebsd = ebsd(grains);
[grains,ebsd.grainId,ebsd.mis2mean] = calcGrains(ebsd('indexed'),'angle',seg_angle*degree);
plot(grains)
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_Whole_Map_Phase_Fo_En_Di_map.png')
%************************************************************************************
%% Grain boundaries Forsterite - green
%************************************************************************************
% respectively and display Fo-Fo, Fo-En and Fo-Di labels on map legend
figure
% plot boundary Fo-Fo
plot(grains('Fo').boundary('Fo','Fo'),'linecolor','g','linewidth',3,'displayName','Fo-Fo boundary')
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_Whole_Map_Phase_Fo_map.png')
%************************************************************************************
%% Misoriention angle  : Grain boundaries olivine - green
%************************************************************************************
gB_FoFo = grains.boundary('Fo','Fo');
figure
plot(gB_FoFo,gB_FoFo.misorientation.angle./degree,'linewidth',2)
mtexColorMap blue2red
mtexColorbar
hold off
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_Whole_Map_Phase_Fo_gB_misorientation_map.png')
%************************************************************************************
%% Grain boundaries enstatite - red
%************************************************************************************
% respectively and display En-En on map legend
figure
% plot boundary En-En
plot(grains('En').boundary('En','En'),'linecolor','r','linewidth',3,'displayName','En-En boundary')
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_Whole_Map_Phase_En_map.png')
%************************************************************************************
%% Misoriention angle  : Grain boundaries enstatite - red
%************************************************************************************
gB_EnEn = grains.boundary('En','En');
figure
plot(gB_EnEn,gB_EnEn.misorientation.angle./degree,'linewidth',2)
mtexColorMap blue2red
mtexColorbar
hold off
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_Whole_Map_Phase_En_gB_misorientation_map.png')
%************************************************************************************
%% Grain boundaries Diopside - blue
%************************************************************************************
% respectively and display Di-Di on map legend
figure
% plot boundary Di-Di
plot(grains('Di').boundary('Di','Di'),'linecolor','b','linewidth',3,'displayName','Di-Di boundary')
%************************************************************************************
%% Misoriention angle  : Grain boundaries Diopside - blue
%************************************************************************************
gB_DiDi = grains.boundary('Di','Di');
figure
plot(gB_DiDi,gB_DiDi.misorientation.angle./degree,'linewidth',2)
mtexColorMap blue2red
mtexColorbar
hold off
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_Whole_Map_Phase_Di_map.png')
%************************************************************************************
%% Phase boundaries in multi-phase rock Fo-Fo, Fo-En, Fo-Di,En-Di, En-En and Di-Di
%  with green red blue and magenta
%************************************************************************************
% respectively and display Fo-Fo, Fo-En and Fo-Di labels on map legend
close all
figure
% plot boundary Fo-Fo
plot(grains('Fo').boundary('Fo','Fo'),'linecolor','g','linewidth',3,'displayName','Fo-Fo boundary')
hold on
% plot boundary Fo-En
plot(grains('Fo').boundary('Fo','En'),'linecolor','r','linewidth',3,'displayName','Fo-En boundary')
hold on
% plot boundary Fo-Di
plot(grains('Fo').boundary('Fo','Di'),'linecolor','b','linewidth',3,'displayName','Fo-Di boundary')
hold on
% plot boundary En-Di
plot(grains('En').boundary('En','Di'),'linecolor','c','linewidth',3,'displayName','En-Di boundary')
% plot boundary En-En
plot(grains('En').boundary('En','En'),'linecolor','m','linewidth',3,'displayName','En-En boundary')
% plot boundary Di-Di
plot(grains('En').boundary('Di','Di'),'linecolor','y','linewidth',3,'displayName','Di-Di boundary')
hold off
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_Whole_Map_Phase_gB_Fo_En_Di_map.png')
%**************************************************************************
%% Phase boundaries in multi-phase rock Fo-Fo, Fo-En, Fo-Di and En-Di
% with green red blue cyan magenta and yellow
% Correlated neighbour-neighbour misorientation angles
% The only relationship with physical meaning at the grain boundary
%**************************************************************************
% 6 possible boundaries
gB_FoFo = grains.boundary('Fo','Fo');
gB_FoEn = grains.boundary('Fo','En');
gB_FoDi = grains.boundary('Fo','Di');
gB_EnDi = grains.boundary('En','Di');
gB_EnEn = grains.boundary('En','En');
% not found Di-Di
gB_DiDi = grains.boundary('Di','Di');
%% Maximum misorientation angles
FoFo_max_angle = max(gB_FoFo.misorientation.angle./degree)
FoEn_max_angle = max(gB_FoEn.misorientation.angle./degree)
FoDi_max_angle = max(gB_FoDi.misorientation.angle./degree)
EnDi_max_angle = max(gB_EnDi.misorientation.angle./degree)
%**************************************************************************
%% Histogram of misorientation angles at grain and phase boundaries
%**************************************************************************
setMTEXpref('FontSize',25)
figure
plotAngleDistribution(gB_FoFo.misorientation,'DisplayName','Fo-Fo')
hold on
plotAngleDistribution(gB_EnEn.misorientation,'DisplayName','En-En')
hold on
plotAngleDistribution(gB_FoEn.misorientation,'DisplayName','Fo-En')
hold on
plotAngleDistribution(gB_FoDi.misorientation,'DisplayName','Fo-Di')
hold on
plotAngleDistribution(gB_EnDi.misorientation,'DisplayName','En-Di')
hold off
mtexTitle('Correlated grain and phase boundary misorientation angles')
legend('show','Location','northwest')
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_Whole_Histo_Grain_Phase_gB_Fo_En_Di_misangles.png')
%% Boundary misorientation axes in crystallographic coordinates for all angles
% Fo-Fo : orthorhombic - orthorhombic
close all
figure
plot(gB_FoFo.misorientation.axis,'contourf','fundamentalRegion')
mtexColorbar
% Olivine 11 reference habit planes in order of decreasing d-space from (010) to (130)
Habit_planes_Fo = [...
    Miller(0,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,0,1,ebsd('fo').CS,'hkl'),...
    Miller(0,1,1,ebsd('fo').CS,'hkl'),...
    Miller(1,0,0,ebsd('fo').CS,'hkl'),...
    Miller(1,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,2,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,0,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,2,0,ebsd('fo').CS,'hkl'),...
    Miller(0,3,1,ebsd('fo').CS,'hkl'),... 
    Miller(0,1,2,ebsd('fo').CS,'hkl'),...
    Miller(1,3,0,ebsd('fo').CS,'hkl'),...
    ];
annotate(symmetrise(Habit_planes_Fo),'labeled','BackgroundColor','w','MarkerSize',15)
mtexTitle('Correlated grain Fo(mmm)-Fo(mmm) boundary misorientation axes')
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_IPF_Grain_Phase_gB_Fo_Fo_mis_axes.pdf')
%% Fo-En : orthorhombic - orthorhombic
close all
figure
plot(gB_FoEn.misorientation.axis,'contourf','fundamentalRegion')
mtexColorbar
% Olivine 11 reference habit planes in order of decreasing d-space from (010) to (130)
Habit_planes_Fo = [...
    Miller(0,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,0,1,ebsd('fo').CS,'hkl'),...
    Miller(0,1,1,ebsd('fo').CS,'hkl'),...
    Miller(1,0,0,ebsd('fo').CS,'hkl'),...
    Miller(1,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,2,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,0,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,2,0,ebsd('fo').CS,'hkl'),...
    Miller(0,3,1,ebsd('fo').CS,'hkl'),... 
    Miller(0,1,2,ebsd('fo').CS,'hkl'),...
    Miller(1,3,0,ebsd('fo').CS,'hkl'),...
    ];
annotate(symmetrise(Habit_planes_Fo),'labeled','BackgroundColor','w','MarkerSize',15)
mtexTitle('Correlated grain Fo(mmm)-En(mmm) boundary misorientation axes')
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_IPF_Grain_Phase_gB_Fo_En_mis_axes.pdf')
%% Fo-Di : orthorhombic - monoclinic : NB mirror due Fo orthorhombic
close all
figure
plot(gB_FoDi.misorientation.axis,'contourf','fundamentalRegion')
misorientation_axes = [...
    Miller(2,3,4,ebsd('fo').CS,'uvw'),...
    ];
annotate(symmetrise(misorientation_axes),'labeled','BackgroundColor','w','MarkerSize',15)
mtexColorbar
mtexTitle('Correlated grain Fo(mmm)-Di(12/m1) boundary misorientation axes')
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_IPF_Grain_Phase_gB_Fo_Di_mis_axes.pdf')
%% En-Di : orthorhombic - monoclinic : NB mirror due En orthorhombic
close all
figure
plot(gB_EnDi.misorientation.axis,'contourf','fundamentalRegion')
misorientation_axes = [...
    Miller(4,1,1,ebsd('fo').CS,'uvw'),...
    ];
annotate(symmetrise(misorientation_axes),'labeled','BackgroundColor','w','MarkerSize',15)
mtexColorbar
mtexTitle('Correlated grain En(mmm)-Di(12/m1) boundary misorientation axes')
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_IPF_Grain_Phase_gB_En_Di_mis_axes.pdf')
%**************************************************************************
%% Correlated Grain Boundary Misorientation Distribution (BMDF) contours
%**************************************************************************
% Can use antipodal option between same phases FoFo
setMTEXpref('FontSize',25)
close all
figure
% *** Crystallographic a-axes to East ***
plota2east
% plot section
plotSection(gB_FoFo.misorientation,'axisAngle',[10 15 20 30 40 50 60 70 80 90 100 110 115]*degree,...
     'axisAngle','projection','earea','volumeScaling',false,'contourf','antipodal','MarkerFaceColor','b','MarkerEdgeColor','b')
% Olivine 11 reference habit planes in order of decreasing d-space from (010) to (130)
Habit_planes_Fo = [...
    Miller(0,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,0,1,ebsd('fo').CS,'hkl'),...
    Miller(0,1,1,ebsd('fo').CS,'hkl'),...
    Miller(1,0,0,ebsd('fo').CS,'hkl'),...
    Miller(1,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,2,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,0,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,2,0,ebsd('fo').CS,'hkl'),...
    Miller(0,3,1,ebsd('fo').CS,'hkl'),... 
    Miller(0,1,2,ebsd('fo').CS,'hkl'),...
    Miller(1,3,0,ebsd('fo').CS,'hkl'),...
    ];
annotate(symmetrise(Habit_planes_Fo),'labeled','BackgroundColor','w','MarkerSize',15)
%mtexTitle('Correlated Grain Boundary Misorientation Distribution (MDF) - points')
number_of_points = length(gB_FoFo.misorientation)
% Flush event queue - gives more accurate result near edges of plot
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Whole_Map_BMDF_high_angle_misorientation_boundary_axes_plot_FoFo.png')
%**************************************************************************
%% Using MTEX quiver for grain boundary rotation axes in specimen coordinates
%  with 2 times reduced sampling  using 'misrotation'
%**************************************************************************
Sampling_N=2;
% Create arrays to make sampling easier
gB_boundaries_Fo_Fo = grains('Fo').boundary('Fo','Fo');
gB_axes_Fo_Fo = gB_FoFo.misrotation.axis;
close all
figure
plot(grains('Fo').boundary('Fo','Fo'),'linecolor','g','linewidth',2,'DisplayName','Fo-Fo')
hold on
quiver(gB_boundaries_Fo_Fo(1:Sampling_N:end),gB_axes_Fo_Fo(1:Sampling_N:end),...
    'linewidth',2,'linecolor','r','autoScaleFactor',0.8,'maxHeadSize',5)
% Flush event queue - gives more accurate result near edges of plot
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Whole_Map_misorientation_boundary_axes_plot_gB_FoFo.png')
%**************************************************************************
%% gB rotation axes in pole figure specimen coordinates (over all angles)
% using 'misrotation' N.B. antipodal
%**************************************************************************
close all
figure
plot(gB_FoFo.misrotation.axis,'antipodal','contourf')
mtexColorbar
mtexTitle('Correlated grain Fo-Fo boundary misorientation axes')
annotate([xvector,yvector,zvector],'label',{'X','Y','Z'},'backgroundcolor','w','MarkerSize',15,'FontSize',25)
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Whole_Map_misorientation_boundary_axes_PF_gB_FoFo.png')
%**************************************************************************
%% gB rotation axes in inverse pole figure crystal coordinates (over all axes)
% using 'misorientation'
%**************************************************************************
figure
plot(gB_FoFo.misorientation.axis,'antipodal','contourf','FundamentalRegion')
mtexColorbar
% Olivine 11 reference habit planes in order of decreasing d-space from (010) to (130)
Habit_planes_Fo = [...
    Miller(0,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,0,1,ebsd('fo').CS,'hkl'),...
    Miller(0,1,1,ebsd('fo').CS,'hkl'),...
    Miller(1,0,0,ebsd('fo').CS,'hkl'),...
    Miller(1,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,2,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,0,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,2,0,ebsd('fo').CS,'hkl'),...
    Miller(0,3,1,ebsd('fo').CS,'hkl'),... 
    Miller(0,1,2,ebsd('fo').CS,'hkl'),...
    Miller(1,3,0,ebsd('fo').CS,'hkl'),...
    ];
annotate(symmetrise(Habit_planes_Fo),'labeled','BackgroundColor','w','MarkerSize',15)
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Whole_Map_misorientation_boundary_axes_IPF_gB_FoFo.png')
%**************************************************************************
%% Correlated Grain Boundary Misorientation Distribution (BMDF) contour
%**************************************************************************
% *** No antipodal option between difference phases FoEn ***
setMTEXpref('FontSize',25)
close all
figure
% *** Crystallographic a-axes to East ***
plota2east
% plot section
plotSection(gB_FoEn.misorientation,'axisAngle',[10 15 20 30 40 50 60 70 80 90 100 110 115]*degree,...
     'axisAngle','projection','earea','volumeScaling',false,'contourf','MarkerFaceColor','b','MarkerEdgeColor','b')
% Olivine 11 reference habit planes in order of decreasing d-space from (010) to (130)
Habit_planes_Fo = [...
    Miller(0,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,0,1,ebsd('fo').CS,'hkl'),...
    Miller(0,1,1,ebsd('fo').CS,'hkl'),...
    Miller(1,0,0,ebsd('fo').CS,'hkl'),...
    Miller(1,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,2,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,0,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,2,0,ebsd('fo').CS,'hkl'),...
    Miller(0,3,1,ebsd('fo').CS,'hkl'),... 
    Miller(0,1,2,ebsd('fo').CS,'hkl'),...
    Miller(1,3,0,ebsd('fo').CS,'hkl'),...
    ];
annotate(symmetrise(Habit_planes_Fo),'labeled','BackgroundColor','w','MarkerSize',15)
%mtexTitle('Correlated Grain Boundary Misorientation Distribution (MDF) - points')
number_of_points = length(gB_FoEn.misorientation)
% Flush event queue - gives more accurate result near edges of plot
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Whole_Map_BMDF_high_angle_misorientation_boundary_axes_plot_gB_FoEn.png')
%**************************************************************************
%% Using MTEX quiver for grain boundary rotation axes in specimen coordinates
%  with 2 times reduced sampling using 'misrotation'
%**************************************************************************
Sampling_N=2;
% Create arrays to make sampling easier
gB_boundaries_Fo_En = grains('Fo').boundary('Fo','En');
gB_axes_Fo_En = gB_FoEn.misrotation.axis;
close all
figure
plot(grains('Fo').boundary('Fo','En'),'linecolor','r','linewidth',2,'DisplayName','Fo-En')
hold on
quiver(gB_boundaries_Fo_En(1:Sampling_N:end),gB_axes_Fo_En(1:Sampling_N:end),...
    'linewidth',2,'linecolor','r','autoScaleFactor',0.8,'maxHeadSize',5)
% Flush event queue - gives more accurate result near edges of plot
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Whole_Map_misorientation_boundary_axes_plot_gB_FoEn.png')
%**************************************************************************
%% gB rotation axes in pole figure specimen coordinates (over all angles)
% using 'misrotation'
%**************************************************************************
figure
plot(gB_FoEn.misrotation.axis,'contourf')
mtexColorbar
annotate([xvector,yvector,zvector],'label',{'X','Y','Z'},'backgroundcolor','w','MarkerSize',15,'FontSize',20)
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Whole_Map_misorientation_boundary_axes_PF_gB_FoEn.png')
%**************************************************************************
%% gB rotation axes in inverse pole figure crystal coordinates (over all axes)
% using 'misorientation'
%**************************************************************************
figure
plot(gB_FoEn.misorientation.axis,'contourf','FundamentalRegion')
mtexColorbar
% Olivine 11 reference habit planes in order of decreasing d-space from (010) to (130)
Habit_planes_Fo = [...
    Miller(0,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,0,1,ebsd('fo').CS,'hkl'),...
    Miller(0,1,1,ebsd('fo').CS,'hkl'),...
    Miller(1,0,0,ebsd('fo').CS,'hkl'),...
    Miller(1,1,0,ebsd('fo').CS,'hkl'),...
    Miller(0,2,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,0,1,ebsd('fo').CS,'hkl'),... 
    Miller(1,2,0,ebsd('fo').CS,'hkl'),...
    Miller(0,3,1,ebsd('fo').CS,'hkl'),... 
    Miller(0,1,2,ebsd('fo').CS,'hkl'),...
    Miller(1,3,0,ebsd('fo').CS,'hkl'),...
    ];
annotate(symmetrise(Habit_planes_Fo),'labeled','BackgroundColor','w','MarkerSize',15)
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Whole_Map_misorientation_boundary_axes_IPF_gB_FoEn.png')
%************************************************************************************
%% Phase boundaries in multi-phase rock Fo-Fo, Fo-En and Fo-Di with green red and blue
%  with phase boundary rotation axes
%************************************************************************************
% respectively and display Fo-Fo, Fo-En and Fo-Di labels on map legend
gB_boundaries_Fo_Di = grains('Fo').boundary('Fo','Di');
gB_axes_Fo_Di = gB_FoDi.misrotation.axis;
gB_boundaries_En_Di = grains('En').boundary('En','Di');
gB_axes_En_Di = gB_EnDi.misrotation.axis;
%**************************************************************************
%% Plot of all phase boundaries and their boundary rotation axes
%**************************************************************************
Sampling_N=6;
Head = 20;
Factor= 0.5;
close all
figure
% plot boundary Fo-Fo
plot(grains('Fo').boundary('Fo','Fo'),'linecolor','g','linewidth',3,'displayName','Fo-Fo boundary')
hold on
quiver(gB_boundaries_Fo_Fo(1:Sampling_N:end),gB_axes_Fo_Fo(1:Sampling_N:end),'linewidth',2,...
    'linecolor','g','color','g','autoScaleFactor',Factor,'maxHeadSize',Head,'displayName','Fo-Fo axis')
hold on
% plot boundary Fo-En
plot(grains('Fo').boundary('Fo','En'),'linecolor','r','linewidth',3,'displayName','Fo-En boundary')
hold on
quiver(gB_boundaries_Fo_En(1:Sampling_N:end),gB_axes_Fo_En(1:Sampling_N:end),'linewidth',2,...
    'linecolor','r','color','r','autoScaleFactor',Factor,'maxHeadSize',Head,'displayName','Fo-En axis')
hold on
% plot boundary Fo-Di
plot(grains('Fo').boundary('Fo','Di'),'linecolor','b','linewidth',3,'displayName','Fo-Di boundary')
hold on
quiver(gB_boundaries_Fo_Di(1:Sampling_N:end),gB_axes_Fo_Di(1:Sampling_N:end),'linewidth',2,...
    'linecolor','b','color','b','autoScaleFactor',Factor,'maxHeadSize',Head,'displayName','Fo-Di axis')
hold on
% plot boundary En-Di
plot(grains('En').boundary('En','Di'),'linecolor','m','linewidth',3,'displayName','En-Di boundary')
hold on
% need smaller Factor here !
Factor=0.2;
quiver(gB_boundaries_En_Di(1:Sampling_N:end),gB_axes_En_Di(1:Sampling_N:end),'linewidth',2,...
    'linecolor','m','color','m','autoScaleFactor',Factor,'maxHeadSize',Head,'displayName','En-Di axis')
hold off
drawNow(gcm,'figSize','large')
set(gcf,'renderer','zBuffer')
%saveFigure('Fo_Whole_Map_Phase_rotation_axes_boundary_axes_all_map.pdf')


