Skip to first unread message

Gerrit Ter Haar

unread,
Sep 12, 2015, 5:19:11 PM9/12/15
to MTEX
Hi all,

I am struggling to plot pole distribution plots using plotPDF that are colored according to orientations from the orientation map called with ipdfHSVOrientationMapping

After loading EBSD data from .crc file and calling a specific phase called 'Ti-Hex': 

The following code plots a pole figure in (0,0,0,1), but using the "wrong" coloring. (RGB). In addition, when trying to plot the other two h orientations, the pole coloring turns black and white.

oM = ipdfHSVOrientationMapping(ebsd('Ti-Hex'))
color
= oM.orientation2color(ebsd('Ti-Hex').orientations);
odf = calcODF(ebsd('Ti-Hex').orientations)
h = [Miller(0,0,0,1,odf.CS),Miller(1,0,-1,0,odf.CS),Miller(-2,1,1,0,odf.CS)];
plotPDF(ebsd('Ti-Hex').orientations,h,'antipodal', ...
    'property',color,'points',10,'MarkerSize',15,'grid','grid_res',15*degree,'complete')




 Instead of what the above output is giving me, I am trying to plot the orientation spectra of color as can be done from using the Inverse Pole Dist Function - plotIPDF. As can be seen bellow:

plot(oM)
hold on
plotIPDF(ebsd('Ti-Hex').orientations,[zvector],'antipodal','property',color,'points',20)



It was interesting to note that when the option 'all' is used instead of specifying the number of points, the correct color is plotted for the pole points:


plotPDF(ebsd('Ti-Hex').orientations,h(1),'antipodal', ...
    'property',color,'all','points',10,'MarkerSize',15,'grid','grid_res',15*degree,'complete')%can also specify 'all' to plot all points 



I am trying to specify the number of points and plot the corect coloring as can be seen from the second pole plot above.


I noticed that in the code for plotPDF(o,h,varargin) there is a comment: "% colorcoding 1 TODO this should be done differently" above the code:


data = get_option(varargin,'property',[]);
% ------------------ subsample if needed --------------------------
if ~check_option(varargin,{'all','contour','contourf','smooth'}) && ...
    (sum(length(o))*length(o.CS)*length(o.SS) > 10000 || check_option(varargin,'points'))

    points = fix(get_option(varargin,'points',10000/length(o.CS)/length(o.SS)));
%   disp(['  I''m plotting ', int2str(points) ,' random orientations out of ', int2str(length(o)),' given orientations']);
%   disp('  You can specify the the number points by the option "points".'); 
%   disp('  The option "all" ensures that all data are plotted');
  
    samples = discretesample(length(o),points);
    o= o.subSet(samples);
    
    if ~isempty(data)
       data = data(samples); 
    end
end



I am wondering if the fault lies with me or with the above code.


Any help on this mater would be very much appreciated. 


Gerrit

Ralf Hielscher

unread,
Sep 12, 2015, 5:55:42 PM9/12/15
to MTEX
Have you checked this with MTEX 4.1?

Ralf

Gerrit Ter Haar

unread,
Sep 14, 2015, 11:01:54 AM9/14/15
to MTEX
Correct. I am using MTex4.1.beta4

Gerrit


On Saturday, September 12, 2015 at 11:19:11 PM UTC+2, Gerrit Ter Haar wrote:

Ralf Hielscher

unread,
Sep 14, 2015, 3:13:42 PM9/14/15
to MTEX
Could you please check MTEX 4.1.1.

Ralf.

Gerrit Ter Haar

unread,
Sep 14, 2015, 5:03:13 PM9/14/15
to MTEX


I have tried MTex 4.1.1. 

plot(oM) now outputs a blank orientations map. 

plotPDF(...) also outputs a blank figure. MTex 4.1.beta4 is at least giving me data plots. (although wrong)

Still frustrating not knowing where the problem lies.


Gerrit

Gerrit Ter Haar

unread,
Sep 14, 2015, 5:54:47 PM9/14/15
to MTEX
Ok,

So after checking the syntax of MTEX 4.1.1. plotPDF() function, I was able to get the correct color from:

plotPDF(ebsd('Ti-Hex').orientations,color,h)

correct color



where "color" is  my data variable. I notice that in the syntax examples (the format that I implemented) one cannot specify the number of points and use the function call as I did above.

plot(oM) still plots blank plots hower. I am wondering if my syntex is wrong.

Gerrit

Rüdiger Kilian

unread,
Sep 15, 2015, 4:54:46 AM9/15/15
to mtex...@googlegroups.com
Hi Gerrit,
does the plot appear if you do a

plot(oM);
set(gcf,'renderer','zbuffer') ;
?

All the best,
Rüdiger


From: mtex...@googlegroups.com [mtex...@googlegroups.com] on behalf of Gerrit Ter Haar [gth.t...@gmail.com]
Sent: Monday, September 14, 2015 11:54 PM
To: MTEX
Subject: {MTEX} Re: Orientation Color Point Pole plots

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

Gerrit Ter Haar

unread,
Sep 15, 2015, 11:40:53 AM9/15/15
to MTEX, ruedige...@unibas.ch
Hi Rüdiger,

Yes! The figure now displays the color map. Thanks so much!

All my issues have now been resolved, except for specifying the number of 'points' in the 

plotPDF(ebsd('Ti-Hex').orientations,color,h,'points',10)


I do not see an example of such syntax in the function 'plotPDF'.
I am sure I would be able to work around this, if I am unable to call the function as above.

Thanks for your help (Rüdiger and Ralf). It is really appreciated!

Regards
Gerrit

Gerrit Ter Haar

unread,
Sep 17, 2015, 3:51:25 AM9/17/15
to MTEX
Hi all,

The function call:

plotPDF(ebsd('Ti-Hex').orientations,color,h,'points',10)

Is working fine.

As well as
plot(oM)
set(gcf,'renderer','zbuffer')

To plot orientation map.

All problems have now been resolved.

Thanks
Reply all
Reply to author
Forward
0 new messages