How do you draw these points into a line in pole figure #2265
Replies: 4 comments 12 replies
-
Do any of these help? plot(h1, 'plane') Or... circle(h1) |
Beta Was this translation helpful? Give feedback.
-
f = fibre(h1,h1)
plotPDF(f,Miller(0,0,0,1,cs)) |
Beta Was this translation helpful? Give feedback.
-
%% Import Data
mtexdata twins
% plot to select grain
figure;
[~, mP] = plot(ebsd, ebsd.orientations);
mP.micronBar.visible = 'off';
hold on;
[grains, ebsd.grainId, ebsd.mis2mean] = calcGrains(ebsd('indexed'), 'angle', 10 * degree);
plot(grains.boundary, 'linewidth', 1);
hold off;
% select grain
g = ginput(1);
grainID = grains.findByLocation(g);
ori = ebsd(ebsd.findByLocation(g)).orientations;
%% Miller info
cs = ori.CS;
h = Miller(0, 0, 0, 1, cs);
h1 = Miller(0, 1, -1, 0, cs, 'uvw');
%% angles for points to plot
angles = 0:10:180;
%% compute rotated orientations
Tori = rotation.byAxisAngle(ori*h1, angles * degree)*ori;
% colormap
colors = turbo(length(angles));
%% Make figure
figure;
% plot rotation-axis great-circle
plot(ori*h1, 'plane','LineColor','k','LineWidth',3,' antipodal','lower')
hold on
% loop through rotated orientations to plot with the colors
for i = 1:length(Tori)
plot(Tori(i)*h,'antipodal','lower','MarkerFaceColor',colors(i,:),'MarkerEdgeColor','none','MarkerSize',16)
end
% add original
plot(ori*h, 'DisplayName', 'Original', 'Marker', 's', 'MarkerSize', 20, 'MarkerFaceColor', 'w', 'MarkerEdgeColor','k','antipodal','lower');
% add rotation axis
plot(ori*h1,'DisplayName', 'Axis', 'Marker', '^', 'MarkerSize', 13, 'MarkerFaceColor', 'k', 'MarkerEdgeColor','k','antipodal','lower')
% add small circles projected from the rotation axis
circle(ori*h1,[10:10:80]*degree,' LineColor',[.5 .5 .5],'LineWidth',.5,'LineStyle','--','antipodal','lower')
hold off;
legend show Does something like this work to get you on a useful track? |
Beta Was this translation helpful? Give feedback.
-
Note: ori = Tori;
%% PRINCIPAL GEODESIC ANALYSIS (PGA)
% PGA computes a dispersion tensor for a set of 3-or-more orientations
% the maximum eigenvector of the dispersion tensor provides a best-fit
% approximation for a rotation axis to describe the distribution of the
% orientation set.
% compute mean about which to project to tangent space
oriRef = mean(ori);
% compute the projection of orientations onto the three dimensional
% tangential space centered about the mean
% query MTEX version because silly syntax differences in different versions
ver = extract(getMTEXpref('version'),digitsPattern);
% adjust depending on version
if str2double(ver{2}) < 11
t = log(ori, oriRef,'left');
else
t = log(ori, oriRef,SO3TangentSpace.leftVector);
end
% covariance matrix as tensor
T = tensor(t*t,'rank',2);
% eigenvectors
[odt, mags] = eig(T);
% sort largest first for compatibility with previous versions
[~,ind] = sort (mags,'descend');
odt = odt(ind);
mags = mags(ind);
%% Make a plot
figure,
plot(Tori*h,'antipodal','lower','MarkerEdgeColor','none','MarkerSize',12)
hold on
% add best-fit rotation axis
plot(odt(1),'Marker','^','MarkerFaceColor','k', 'displayName','fit-rotation-axis')
% and the great circle
plot(odt(1),'plane', 'LineWidth',2)
% some projected small circles
circle(odt(1),[10:10:80]*degree, 'antipodal','lower', 'linestyle', '--','LineColor',[.5 .5 .5],'LineWidth',.5)
hold off
legend show |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions