Re: Plotting Inverse pole figure/Pole figure using Euler angles

3,865 views
Skip to first unread message

Ralf Hielscher

unread,
Jan 29, 2013, 8:05:29 AM1/29/13
to mtex...@googlegroups.com
Dear Soud Farhan,

you may import Euler angles that are stored in a text file in the format

phi1 Phi phi2
phi1 Phi phi2
phi1 Phi phi2
phi1 Phi phi2

Beside this format, MTEX supports also a lot of other formats for importing EBSD data. Please use the Import wizard to load you data. If the import wizard is not able to import the data post your data in this forum.

The import wizard allows you to create an variable containing all the grain orientations. Now you can plot pole figure / inverse pole figures by the commands

plotpdf(ebsd,Miller(1,0,0))
plotipdf
(ebsd,vector3d(1,1,0))

For smooth plots you might consider to estimate first an ODF from you data.

odf = calcODF(ebsd)
plotpdf
(odf,Miller(1,0,0))

All these commands as well as how to import data is also described in the documentation.

Hope this helps.

Ralf.

Ralf Hielscher

unread,
Apr 30, 2013, 9:14:20 AM4/30/13
to mtex...@googlegroups.com
Dear Martin Hacker,

this seems to be a bug in the import wizard getting the correct screen size. We will work on this. In the mean time you can import your data manually by the following commands:

1. define you crystal and specimen symmetry, e.g.,
cs = symmetry('-3m')
ss
= symmetry('triclinic')

2. import you data with
ebsd =loadEBSD_generic('fileName','CS',cs,'SS',ss,'ColumnNames',{'Euler1','Euler2','Euler3'})

3. Plot some pole figures
plotpdf(ebsd,[Miller(1,0,0),Miller(1,1,0)]

I hope this helps you a bit. For every command mentioned above you will find documentation within MATLAB.

Ralf.

Omar Al-Abri

unread,
Aug 29, 2015, 4:08:43 PM8/29/15
to MTEX
Dear All,

I'm trying to plot pole figure using Euler angles that have been imported from a file the EBSD data importing wizard. However, the function 'plotPDF' is obsolete and I have been informed to use calcODF(ebsd.orientations) instead. But still I'm getting error.
Any advise on how to plot pole figure using Euler angles that have been imported as EBSD data?

Thanks and regards,

Omar

Omar Al-Abri

unread,
Sep 1, 2015, 3:05:41 AM9/1/15
to MTEX
Dear Ralf,

I'm trying to plot pole figure using Euler angles imported through EBSD wizard. However, using plotPDF(ebsd,[Miller(1,1,1,cs)]) gives me the following error: Using plotPDF is obsolete since Mtex 4.0. Use plotPDF(ebsd.orientations) instead.

Can you provide an example how to use plotPDF(ebsd.orientations).

Thanks and regards,

Omar
 

On Tuesday, January 29, 2013 at 5:05:29 PM UTC+4, Ralf Hielscher wrote:

Ralf Hielscher

unread,
Sep 1, 2015, 3:20:16 AM9/1/15
to MTEX

Omar Al-Abri

unread,
Sep 1, 2015, 3:43:20 AM9/1/15
to MTEX
Thanks Ralf,

Sorry, it might be a silly question, how to load my data? because the example provided is for forsterite 

Scarlet Kong

unread,
Jul 18, 2018, 12:54:14 AM7/18/18
to MTEX
Hi Ralf,

In regards to this line of code

ebsd =loadEBSD_generic('fileName','CS',cs,'SS',ss,'ColumnNames',{'Euler1','Euler2','Euler3'})

I've tried to load in my .txt file of 3 columns of Euler Angles, but I get the following error

EBSD format 'GENERIC' does not match the data
 file: 'C:/Users/Scarlet Kong/Documents/mtex-5.1.1/data/EBSD/eulerangles_1.txt'

Background on what I'm trying to achieve, I have a simulated data set of 3 Euler Angles and an intensity value for each particular Euler Angles set in the format

phi1 Phi phi2 intensity
phi1 Phi phi2 intensity
phi1 Phi phi2 intensity
...

I want to plot an inverse pole figure of the intensity with respects to the euler angle.

Does that make sense?

Regards,
Scarlet

Rüdiger Kilian

unread,
Jul 18, 2018, 5:41:26 AM7/18/18
to mtex...@googlegroups.com

Hi,
the following lines should load the comment part form a text file, then plot an ipf of the property and try to contour the property.
Note that it seems you'd need to adapt this minor change (https://github.com/mtex-toolbox/mtex/commit/ad05c84df65b85c2c36cfcff874344b56df510fe) from the develop branch to make the contouring work as expected.

% 0 0.1 0.2 0.6
% 0.3 0.4 1.4 0.3
% 1 2.4 0.7 0.1
% 1.9 1.4 0.7 0.1
% 1.2 1.4 0.7 0.2
% 1.1 0.4 1.7 0.1
% 2.1 2.4 0.3 0.1
% 0.3 2.4 0.4 0.8


CS=crystalSymmetry('432');
SS = specimenSymmetry('1');
[o w] = loadOrientation_generic('testEuler.txt','CS',CS,'SS',SS, 'ColumnNames', ...
{'Euler1' 'Euler2' 'Euler3' 'prop'},'Columns',[1,2,3,4],'Radians','Bunge')


plotIPDF(o,w.prop,xvector,'MarkerEdgeColor','r')
nextAxis
plotIPDF(o,w.prop,xvector,'contourf','inverseDistance')
mtexColorbar

Hope that helps.
Cheers,
Rüdiger
________________________________________
From: mtex...@googlegroups.com <mtex...@googlegroups.com> on behalf of Scarlet Kong <scarle...@gmail.com>
Sent: Wednesday, July 18, 2018 4:14:26 AM
To: MTEX
Subject: {MTEX} Re: Plotting Inverse pole figure/Pole figure using Euler angles
--
If you want to reduce the number of emails you get through this forum login to https://groups.google.com/forum/?fromgroups=#!forum/mtexmail, click "My membership" and select "Don't send me email updates". You can still get emails on selected topics by staring them.
---
You received this message because you are subscribed to the Google Groups "MTEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtexmail+u...@googlegroups.com<mailto:mtexmail+u...@googlegroups.com>.
Visit this group at https://groups.google.com/group/mtexmail.
For more options, visit https://groups.google.com/d/optout.

Scarlet Kong

unread,
Jul 23, 2018, 2:34:03 AM7/23/18
to MTEX
Hi Rüdiger,


with the loadOrientation_generic and plotIPDF code you supplied, how does the function actually convert Euler angles into miller indices? 

Thanks in advance!

Regards,
Scarlet


On Wednesday, January 30, 2013 at 12:05:29 AM UTC+11, Ralf Hielscher wrote:

Rüdiger Kilian

unread,
Jul 23, 2018, 3:33:24 AM7/23/18
to mtex...@googlegroups.com
Hi,
plotIPDF plots an inverse pole figure, that means it plots the crystal direction parallel to a reference (specimen) direction; the result of inv(orientation)*specimen direction.

Have a look here:http://mtex-toolbox.github.io/files/doc/CrystalOrientations.html#15

loadOrientation_generic just loads the orientations given in Euler angles from some input file.

Cheers,
Rüdiger
________________________________________
From: mtex...@googlegroups.com <mtex...@googlegroups.com> on behalf of Scarlet Kong <scarle...@gmail.com>
Sent: Monday, July 23, 2018 8:34:03 AM
To: MTEX
Subject: {MTEX} Re: Plotting Inverse pole figure/Pole figure using Euler angles

Scarlet Kong

unread,
Jul 25, 2018, 2:33:00 AM7/25/18
to MTEX
Hi Rüdiger ,

How does MTEX in this case convert Euler angles into miller indices?

Thanks,
Scarlet
To unsubscribe from this group and stop receiving emails from it, send an email to mtexmail+u...@googlegroups.com<mailto:mtexmail+unsubscribe@googlegroups.com>.

Rüdiger Kilian

unread,
Jul 25, 2018, 3:34:05 AM7/25/18
to mtex...@googlegroups.com
Hi Scarlet,
the crystal direction being parallel to a specimen direction is simply the result of inv(o)*r, where o is an orientation (internally represented by quaterions, but which can be specified by humans in many ways, see help orientation/orientation) and where r is a vector in specimen coordiantes.
If you like to know how it is done, have a look at the funktion 'times' of classes quaternion, rotation and orientation.
Hope this helps.
Cheers,
Rüdiger
Message has been deleted

Scarlet Kong

unread,
Jan 1, 2019, 9:49:44 PM1/1/19
to MTEX
Hi Rüdiger,

I have some issues with plotting certain orientations on inverse pole figures using Euler Angles. Please see the attached image. 

For each figure, the Euler Angles in red are not appearing on the inverse pole figure in the position I expect it to be. 
For example, in a) (45, 54.7,0) I expect the point to appear in the [111] corner, as predicted by the miller index. Similar for b) with the other Euler Angles in red. 

I wonder how Mtex is reading in the Euler Angles and plotting it on the inverse pole figure?

My code is as follows:

cs = crystalSymmetry('cubic');
ss = specimenSymmetry('triclinic');

I tried with ss = tetragonal and other symmetries and I still get the same issue.

For calculating the Euler rotations:
>> o = rotation('Euler',0*degree,54.7*degree,45*degree)
 
o = rotation (show methods, plot)
  size: 1 x 1
 
  Bunge Euler angles in degree
  phi1  Phi phi2 Inv.
     0 54.7   45    0
 
>> v = o* zvector
 
v = vector3d (show methods, plot)
 size: 1 x 1
  x         y         z
  0 -0.816138  0.577858

For plotting Euler angles on the inverse pole figure:
>> ori = loadOrientation_generic(fname,'CS',cs,'SS',ss, 'ColumnNames',  {'Euler1' 'Euler2' 'Euler3'},'Columns',[1,2,3],'Degrees','Bunge')
 
ori = orientation (show methods, plot)
  size: 1 x 1
  crystal symmetry : m-3m
  specimen symmetry: 4/mmm
 
  Bunge Euler angles in degree
  phi1  Phi phi2 Inv.
     0 54.7   45    0
 
>> plotIPDF(ori,zvector,'MarkerSize',12,'MarkerEdgeColor','black','points','all')

Where the file "ori_test" is 
phi1    Phi    phi2
0          54.7   45




Euler Angles on IPF.png

Rüdiger Kilian

unread,
Jan 2, 2019, 7:23:52 AM1/2/19
to mtex...@googlegroups.com
Hi Scarlet,
have a look here: http://mtex-toolbox.github.io/files/doc/CrystalOrientations.html#15

Your problem is that you do o*r where r is of vector3d which has a result also vector3d. What you want to do is inv(o)*r to get the Miller which is parallel to r.

Cheers,
Rüdiger

Scarlet Kong

unread,
Jan 2, 2019, 6:14:34 PM1/2/19
to MTEX
Thanks Rüdiger!!

How can I adjust the IPF to just plot the cubic segment of [001], [011] and [111], (or any other segments) instead of the entire projections?
As you can see in the attached image, my data has a cubic symmetry.

previously I was using the following symmetries to show the cubic segment.
>> cs = crystalSymmetry('cubic');
>> ss = specimenSymmetry('triclinic');

But by doing inv(o)*r and plotting it, I had to change the crystalSymmetry to triclinic as well, and this expanded projection area. 

Does that make sense?

Thanks for your help!

Regards,
Scarlet. 
Strain_Inverse_tet_30119.tif

Rüdiger Kilian

unread,
Jan 3, 2019, 4:46:18 AM1/3/19
to mtex...@googlegroups.com
Hi,
when you use inv(o)*r, you can use the option 'fundamentalRegion' when plotting or simply use plotIPF which should take care of that.
Cheers,
Rüdiger

Ralf Hielscher

unread,
Jan 3, 2019, 5:06:26 AM1/3/19
to mtex...@googlegroups.com
Hi Scarlet,

I think it would make a lot of sense if you post, what you really want to plot and attach the full script you have so far.


Ralf.



********************************************************************
Ralf Hielscher                   Tel: +371-531-38556
Fakultät für Mathematik               +371-531-22200 (Sekr.)
Technische Universität Chemnitz  Fax: +371-531-22109
Reichenhainer Str. 39            E-mail: ralf.hi...@mathematik.tu-chemnitz.de
D-09126 Chemnitz                 http://www.tu-chemnitz.de/~rahi
********************************************************************


--
If you want to reduce the number of emails you get through this forum login to https://groups.google.com/forum/?fromgroups=#!forum/mtexmail, click "My membership" and select "Don't send me email updates". You can still get emails on selected topics by staring them.
---
You received this message because you are subscribed to the Google Groups "MTEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtexmail+u...@googlegroups.com.

Scarlet Kong

unread,
Jan 4, 2019, 6:20:10 PM1/4/19
to MTEX
Hi Ralf,

I want to plot all my data points in a cubic segment of the inverse pole figure, just like in the attached image IPF_cubic
Currently, with the following code, my data is appearing in the full projection of the inverse pole figure IPF_full-projection (you can see there is cubic symmetry in my data, from the colours of each point)

cs = crystalSymmetry('triclinic');

ss = specimenSymmetry('triclinic');
fname = [mtexDataPath '/strain/Inverse_tet_30119.txt'];
[o w] = loadOrientation_generic(fname,'CS',cs,'SS',ss, 'ColumnNames',  {'Euler1' 'Euler2' 'Euler3' 'prop'},'Columns',[1,2,3,4],'Degrees','Bunge');
plotIPDF(inv(o),w.prop,zvector,'MarkerSize',12,'MarkerEdgeColor','black','points','all')

I've tried changing the crystalSymmetry and specimenSymmetry, but they don't change the projection of the plots, rather on the placement of my data points in the IPF. 


I hope that makes sense.

Thanks for your help!
-Scarlet
IPF_cubic.jpg
IPF_full-projection.jpg

Ralf Hielscher

unread,
Jan 5, 2019, 12:42:54 AM1/5/19
to MTEX
What about

cs = crystalSymmetry('cubic');

fname
= [mtexDataPath '/strain/Inverse_tet_30119.txt'];

[ori w] = loadOrientation_generic(fname,'CS',cs, 'ColumnNames',  {'Euler1' 'Euler2' 'Euler3' 'prop'},'Columns',[1,2,3,4],'Degrees','Bunge');
plotIPDF
(ori,w.prop,zvector,'MarkerSize',12,'MarkerEdgeColor','black','points','all')


Ralf.

Scarlet Kong

unread,
Jan 28, 2019, 8:09:37 PM1/28/19
to MTEX
Hi Ralf,

By using this
cs = crystalSymmetry('cubic');
fname 
= [mtexDataPath '/strain/Inverse_tet_30119.txt'];

[ori w] = loadOrientation_generic(fname,'CS',cs, 'ColumnNames',  {'Euler1' 'Euler2' 'Euler3' 'prop'},'Columns',[1,2,3,4],'Degrees','Bunge');
plotIPDF
(ori,w.prop,zvector,'MarkerSize',12,'MarkerEdgeColor','black','points','all')

certain orientations on inverse pole figures using Euler Angles do not appear in the correct position. Please see the attached image Euler Angles on IPF
  • For each figure, the Euler Angles in red are not appearing on the inverse pole figure in the position I expect it to be. 
  • For example, in a) (45, 54.7,0) I expect the point to appear in the [111] corner, as predicted by the miller index. Similar for b) with the other Euler Angles in red. 
Rüdiger replied saying I should apply inv(o)*r to get the Miller which is parallel to r to get the Euler Angles in the correct position on the inverse pole figure. 

Thus, my code is
cs = crystalSymmetry('triclinic');
ss = specimenSymmetry('triclinic');
fname = [mtexDataPath '/strain/Inverse_tet_30119.txt'];
[o w] = loadOrientation_generic(fname,'CS',cs,'SS',ss, 'ColumnNames',  {'Euler1' 'Euler2' 'Euler3' 'prop'},'Columns',[1,2,3,4],'Degrees','Bunge');
plotIPDF(inv(o),w.prop,zvector,'MarkerSize',12,'MarkerEdgeColor','black','points','all')

and the inverse pole figure results in the image Strain_Inverse_tet_30119

I had to put crystalSymmetry and specimenSymmetry as triclinic since the system I am trying to model has low symmetry. 
But as you can see from the image, the resulting data shows cubic symmstry. I would like to just plot the cubic segment of an inverse pole figure with my data. 

Changing the crystalSymmetry to anything other than triclinic results in the image crystalSymmetry_Cubic.
Changing the specimenSymmetry doesn't do anything to the inverse pole figure. Triclinic or Cubic, the full projection of the inverse pole figure appears. 

Is there any way I can just plot a cubic segment of my data on the inverse pole figure using the code above?

Thanks in advance!

Kind Regards,
Scarlet
Euler Angles on IPF.png
Strain_Inverse_tet_30119.tif
crystalSymmetry_cubic.PNG

Ralf Hielscher

unread,
Jan 29, 2019, 1:51:50 AM1/29/19
to MTEX
Hi Scarlet,

it seems you Euler angles are flipped around, which causes the problem with the symmetry. Could you try

cs = crystalSymmetry('cubic');
fname
= [mtexDataPath '/strain/Inverse_tet_30119.txt'];
[o w] = loadOrientation_generic(fname,'CS',cs,'SS',ss, 'ColumnNames',  {'phi2' 'Phi' 'phi1' 'prop'},'Columns',[1,2,3,4],'Degrees','Bunge');
plotIPDF
(o,w.prop,zvector,'MarkerSize',12,'MarkerEdgeColor','black','points','all')h '/strain/Inverse_tet_30119.txt'];

Ralf.
Reply all
Reply to author
Forward
0 new messages