mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
281 stars 185 forks source link

Getting the colormap associated with simple EBSD map #188

Closed DavidMainprice closed 8 years ago

DavidMainprice commented 8 years ago

This is EBSD map that does not use "oM "for its colorbar or it does, but it not obvious to find it.

%% Orientation map using the rotation angle in specimen coordinates to define the colormap
% For example point (x,y)= 88,-20 Euler = (17,88,356) on extreme right side of the single antigorite grain map
% User defined REFERENCE ORIENTATION Bunge Euler angles (17,88,356) degrees
reference_o = orientation('Euler',17*degree,88*degree,356*degree,ebsd('Antigorite').CS)
single_grain_EBSD = ebsd(grain_with_max_GOS);
figure
plot(single_grain_EBSD('Antigorite'),angle(single_grain_EBSD('Antigorite').orientations,reference_o)./degree)
mtexColorbar

Hence the colorbar is defined by a series of angles given by

angle(single_grain_EBSD('Antigorite').orientations,reference_o)./degree

It would be useful to use the same orientation colobar/colormap in a plot of pole figures of individual orientations.

Does anyone have any suggestions ?

all the best David

DavidMainprice commented 8 years ago

Here is the solution to my own question !

reference_o = orientation('Euler',17*degree,88*degree,356*degree,ebsd('Antigorite').CS)

%% Plot pole figures of single grain with maximum GOS color coded with angle from reference orientation
plotPDF(Orientations_in_grain,PF_List,'property',angle(single_grain_EBSD('Antigorite').orientations,reference_o)./degree,...
    'antipodal','MarkerSize',15)
mtexColorbar

You can replace with all orientations in the map with ebsd('Antigorite').orientations

all the best David

DavidMainprice commented 8 years ago

For some reason the GitHub removes some of the '*' for degrees as in

reference_o = orientation('Euler',17*degree,88*degree,356*degree,ebsd('Antigorite').CS)

all the best David

DavidMainprice commented 8 years ago

It has done it again ! The star multiplication for degrees

all the best David

ralfHielscher commented 8 years ago

Hi David,

the more correct syntax is

reference_o = orientation('Euler',17*degree,88*degree,356*degree,ebsd('Antigorite').CS)

%% Plot pole figures of single grain with maximum GOS color coded with angle from reference orientation
plotPDF(Orientations_in_grain,angle(single_grain_EBSD('Antigorite').orientations,reference_o)./degree,...
  PF_List,'antipodal','MarkerSize',15)
mtexColorbar

as it follows the general schema

plot(location, value)

Ralf.