Plotting grains in IPF sector by grain size?

218 views
Skip to first unread message

MTEXNewbie

unread,
Sep 23, 2017, 1:13:17 PM9/23/17
to MTEX
I have drawn the below IPF sector by this code -

figure
plotIPDF(odf,oM.inversePoleFigureDirection,'antipodal','resolution',0.1*degree)
% mtexColorMap white2black
hold on
plotIPDF(grains('Iron fcc').meanOrientation,oM.inversePoleFigureDirection,'points','all','MarkerSize',2,'MarkerFaceColor','k','MarkerEdgeColor','k');
mtexColorbar
% setColorRange([0.25 3.0])
hold off

Is there a way to plot the grains as a function of the grain size (from grains.grainSize, obtaining a normalized 'MarkerSize' = (Individual grains / smallest grain size)?


 

Rüdiger Kilian

unread,
Sep 24, 2017, 5:46:31 AM9/24/17
to mtex...@googlegroups.com
Hi, if you make a plot of points, mtex will treat the second argument as value assigned to each point which will be used for color coding. e.g. plotPDF(grains.meanOrientation, grains.grainSize,h). However setting MarkerSize for each point this way is not supported.
Cheers,
Rüdiger

MTEXNewbie

unread,
Sep 24, 2017, 8:30:06 AM9/24/17
to MTEX
Hi,

Could you please include your suggestion in below code? I tried with it but could not make it work as you have suggested -

ruediger Kilian

unread,
Sep 24, 2017, 8:38:28 AM9/24/17
to mtex...@googlegroups.com
Hi,
as stated in the help e.g. for plotIPDF the syntax is plotIPDF(ori,data,specimendirection) where data is your property that will be colorcoded (in case you opt to plot points) and it goes right between the orientations and the reference direction for your ipf.
Hope that helps.
Cheers,
Rüdiger

Ralf Hielscher

unread,
Sep 24, 2017, 10:03:34 AM9/24/17
to mtex...@googlegroups.com
There was recently a similar question. As a result I made it possible that markerSize can be a vector of different values. It requires the change


Are you able to apply this change to your installation? If not you have to wait for MTEX 4.5.2.

then you can do

plotPDF(grains.meanOrientation,h,'MarkerSize',grains.grainSize)

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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/mtexmail.
For more options, visit https://groups.google.com/d/optout.

MTEXNewbie

unread,
Sep 24, 2017, 10:26:42 AM9/24/17
to MTEX
Hi Ralf,

Thanks for chiming in, I have replaced the scatter.m file with your updated version.

plotIPDF(grains('Iron fcc').meanOrientation,h,'MarkerSize',grains.grainSize)
Or,
plotIPDF(grains('Iron fcc').meanOrientation,h,oM.inversePoleFigureDirection,'points','all','MarkerSize',grains.grainSize)

But both resulted in errors -

 estimate optimal kernel halfwidth: 100%
Error using scatter (line 69)
X and Y must be vectors of the same length.

Error in vector3d/scatter (line 124)
      h(i) =
      optiondraw(scatter(x,y,MarkerSize,'parent',sP(i).hgt,...

Error in Miller/scatter (line 59)
[varargout{1:nargout}] = scatter@vector3d(m,varargin{:},m.CS);

Error in vector3d/plot (line 52)
    [varargout{1:nargout}] = v.scatter(varargin{:});

Error in vector3d/subsref (line 23)
    [varargout{1:nargout}] = builtin('subsref',v,s);

Error in orientation/plotIPDF (line 78)
  h.plot(repmat(data,1,length(rSym)),'symmetrised',...

Error in Steel_90_cross (line 195)
plotIPDF(grains('Iron
fcc').meanOrientation,h,'MarkerSize',grains.grainSize)


ruediger Kilian

unread,
Sep 24, 2017, 10:56:15 AM9/24/17
to mtex...@googlegroups.com
Hi,
grains are not the same size as grains('Iron fcc’) so you should also use the latter to specify the MarkerSize.
Btw, if h in your command is a Miller, I’m not really sure of you want to have this there, it will likely not produce what you want - assuming you want to use the ref. direction oM.inversePoleFigureDirection.
Cheers,
Rüdiger


MTEXNewbie

unread,
Sep 24, 2017, 11:04:43 AM9/24/17
to MTEX
Hi ruediger,

I have used this code now -
plotIPDF(grains.meanOrientation,oM.inversePoleFigureDirection,'points','all','MarkerSize',grains.grainSize)

Error message -
estimate optimal kernel halfwidth: 100%
Error using phaseList/checkSinglePhase (line 282)
This operatorion is only permitted for a single phase! Please
see modify EBSD data  for how to restrict EBSD data to a
single phase.

Error in phaseList/get.CS (line 154)
      id = checkSinglePhase(pL);

Error in grain2d/get.meanOrientation (line 149)
      ori = orientation(grains.prop.meanRotation,grains.CS);

Error in grain2d/subsref (line 32)
  [varargout{1:nargout}] = builtin('subsref',grains,s);

Error in Steel_90_cross (line 195)
plotIPDF(grains.meanOrientation,oM.inversePoleFigureDirection,'points','all','MarkerSize',grains.grainSize)


ruediger Kilian

unread,
Sep 24, 2017, 11:13:01 AM9/24/17
to mtex...@googlegroups.com
Hi,
yes, if you want to query orientations you need to restrict this to a single phase, like you did before, use grains('Iron fcc’)

Another thing that you might need to do (in case you still have an error - which I still get) is that you might need to use plot instead of plotIPDF for now and calculate the Millers you want to plot.

If o is the orientation and r is your reference direction and s is the size you want to use of length o:
h = inv(o).*r;
plot(project2Fundamentalregion(h),’MarkerSize’,s,’FundamentalRegion’)
Cheers,
Rüdiger



MTEXNewbie

unread,
Sep 24, 2017, 11:35:04 AM9/24/17
to MTEX
Thanks for the workaround. However, I find working with standard MTEX procedure is much easier to understand.

Hopefully, Ralf will be able to shed some light on this problem.

MTEXNewbie

unread,
Nov 27, 2017, 8:31:00 AM11/27/17
to MTEX
In MTEX 4.5.2, this code worked -

plotIPDF(grains('Iron fcc').meanOrientation,oM.inversePoleFigureDirection,'points','all','MarkerSize',grains('Iron fcc').grainSize/120,'MarkerFaceColor','k','MarkerEdgeColor','k');

1. Some grains are going out of the sector since they are so big, so I divided all grains by 120, is this approach valid or there is another good way to do it?

2. Can 'DynamicMarkerSize' be used in IPF sector?

'DynamicMarkerSize' scale marker size when plot is resized


Ralf Hielscher

unread,
Dec 4, 2017, 4:19:26 PM12/4/17
to MTEX
DynamicMarkerSize can not be combined with an explicite MarkerSize

Ralf.
Reply all
Reply to author
Forward
0 new messages