% You run this script to test for yourself
%
%% Clear memory and close all plots
clear all;
close all;
%% import MTEX example data set
mtexdata forsterite
%
% crystal symmetry
CS = {...
'notIndexed',...
crystalSymmetry('mmm', [4.756 10.207 5.98], 'mineral', 'Forsterite', 'color', 'dark green'),...
crystalSymmetry('mmm', [18.2406 8.8302 5.1852], 'mineral', 'Enstatite', 'color', 'light red'),...
crystalSymmetry('12/m1', [9.746 8.99 5.251], [90,105.63,90]*degree, 'X||a*', 'Y||b*', 'Z||c', 'mineral', 'Diopside', 'color', 'dark blue'),...
crystalSymmetry('m-3m', [5.431 5.431 5.431], 'mineral', 'Silicon', 'color', 'cyan')};
%
% 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
%% For list of Miller there are 3 syntax (h1,h2,h3)
% h1 and h2 work with this example, but h3 will not plot
h1 = [Miller(1,0,0,ebsd('Fo').CS,'hkl'),Miller(0,1,0,ebsd('Fo').CS,'hkl'),Miller(0,0,1,ebsd('Fo').CS,'hkl')]
h2 = Miller({1,0,0},{0,1,0},{0,0,1},ebsd('Fo').CS,'uvw')
h3 = {Miller(1,0,0,ebsd('Fo').CS,'hkl'),Miller(0,1,0,ebsd('Fo').CS,'hkl'),Miller(0,0,1,ebsd('Fo').CS,'hkl')}
% plot orientation color coded with property : Band contrast ebsd('Fo').bc
% Syntax where = ebsd('Fo').orientations what = ebsd('Fo').bc
plotPDF(ebsd('Fo').orientations,ebsd('Fo').bc,h3,'antipodal','MarkerSize',8)
mtexColorbar
drawNow(gcm,'figSize','medium')