How to calculate Grains with IPF colors using grains.meanOrientation #2154
Unanswered
Sogo5030
asked this question in
Ask Anything
Replies: 2 comments
-
It simply seems to me you use the wrong variable for your grains? It basically cannot find the variable 'grains'. |
Beta Was this translation helpful? Give feedback.
0 replies
-
As mentioned in another reply, the error indicates that MTEX does not find a variable named “grains” in your workspace variables at the point in your code where you call for it. Looking at the code, I see you import some EBSD data… but I don’t see where you compute/construct grains from the EBSD data. If you add a grain reconstruction step (and name the subsequent variable “grains”) that error should resolve. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to Plot grains with IPF colours using grains.meanOrientation X, Y and Z - Cubic. However, I obtained the following errors, I have tried to find the error but to no avail:
ipfKey = ipfColorkey(grains('Ferrite, bcc (New)'));
Cannot find an exact (case-sensitive) match for 'grains'
The closest match is: Grains in
C:\Users\Desktop\MATLAB\mtex-5.11.2\mtex-5.11.2\doc\Grains\Grains.m
Below is my code:
% crystal symmetry
CS = {...
'notIndexed',...
crystalSymmetry('m-3m', [2.9 2.9 2.9], 'mineral', 'Ferrite, bcc (New)', 'color', [0.53 0.81 0.98])};
% plotting convention
setMTEXpref('xAxisDirection','north');
setMTEXpref('zAxisDirection','outOfPlane');
%% Specify File Names
% path to files
pname = 'C:\Users\Desktop\MATLAB';
% which files to be imported
fname = [pname '\map.ctf'];
%% Import the Data
% create an EBSD variable containing the data
ebsd = EBSD.load(fname,CS,'interface','ctf',...
'convertEuler2SpatialReferenceFrame');
%% Import the Data
figure();
oM = ipfHSVKey(ebsd('Ferrite, bcc (New)'));
oM.inversePoleFigureDirection = xvector;
color = oM.orientation2color(ebsd('Ferrite, bcc (New)').orientations);
plot(ebsd('Ferrite, bcc (New)'),color);
figure();
oM = ipfHSVKey(ebsd('Ferrite, bcc (New)'));
oM.inversePoleFigureDirection = yvector;
color = oM.orientation2color(ebsd('Ferrite, bcc (New)').orientations);
plot(ebsd('Ferrite, bcc (New)'),color);
figure();
oM = ipfHSVKey(ebsd('Ferrite, bcc (New)'));
oM.inversePoleFigureDirection = zvector;
color = oM.orientation2color(ebsd('Ferrite, bcc (New)').orientations);
plot(ebsd('Ferrite, bcc (New)'),color);
%% rotate the orientation data but not the spatial data
rot=rotation('Euler', 90degree, 0degree, 0*degree);
ebsd=rotate(ebsd,rot,'keepXY'); % 'keepXY' allows you to apply a rotation to your orientation data without changing the spatial data
**figure();
ipfKey = ipfColorKey(grains('Ferrite, bcc (New)'));
ipfKey.inversePoleFigureDirection = xvector;
color = ipfKey.orientation2color(grains('Ferrite, bcc (New)').meanOrientation);
plot(grains('Ferrite, bcc (New)'),color);
figure();
ipfKey = ipfColorKey(grains('Ferrite, bcc (New)'));
ipfKey.inversePoleFigureDirection = yvector;
color = ipfKey.orientation2color(grains('Ferrite, bcc (New)').meanOrientation);
plot(grains('Ferrite, bcc (New)'),color);
figure();
ipfKey = ipfColorKey(grains('Ferrite, bcc (New)'));
ipfKey.inversePoleFigureDirection = zvector;
color = ipfKey.orientation2color(grains('Ferrite, bcc (New)').meanOrientation);
plot(grains('Ferrite, bcc (New)'),color);**
Beta Was this translation helpful? Give feedback.
All reactions