grain2d.findByLocation edit page

select a grain by spatial coordinates

Syntax

id = findByLocation( grains, pos )

Input

grains grain2d
pos vector3d, [x(:) y(:)], or [x(:) y(:) z(:)]

Output

grains list of grainIds

Example

mtexdata small silent
grains = calcGrains(ebsd('indexed'))
plot(grains)
grains = grain2d (y↑→x)
 
 Phase  Grains  Pixels     Mineral  Symmetry  Crystal reference frame
     1      24    1952  Forsterite       mmm                         
     2       8     290   Enstatite       mmm                         
     3      44     282    Diopside     12/m1       X||a*, Y||b*, Z||c
 
 boundary segments: 1139 (52148 µm)
 inner boundary segments: 22 (1101 µm)
 triple points: 68
 
 Properties: meanRotation, GOS
p = [35000 5000] % for mouse selection use  p = ginput(1)
id = findByLocation(grains,p);
hold on, plot(grains(id).boundary,'linecolor','r','lineWidth',2), hold off
p =
       35000        5000

See also

EBSD.findByLocation grain2d.findByOrientation