plot hkl and uvw pole figures in same plot; scale all pole figures to same max contour

274 views
Skip to first unread message

Elena Miranda

unread,
Oct 9, 2014, 2:38:43 PM10/9/14
to mtex...@googlegroups.com
Hello Ralf and fellow MTEX users,

I'm using MTEX 3.5.0 with MATLAB version R2011b.

I'd like to set a maximum contour level for a series of different contoured pole figures for the mineral kyanite within a single sample. For example, I want to display the {100} {010} and <001> pole figures for the mineral kyanite all in the same figure, and then contour them so that all three figures are scaled according to my user-specified maximum. The first problem that I have is that the resulting figure displays the {100} {010} and {001} pole figures instead of {100} {010} and <001> pole figures (see attached figure). I specified the number of contours at 8 hoping that the maximum density would be scaled to 8 for all 3 plots, but this is not the case. When I run this script, I see a very long list of identical warning messages in the Command window saying "Unable to interpret LaTex string 1, res.: 2.5º", but I don't understand what these mean.

I then tried to use the subplot feature to assemble all three pole figures, but the resulting plot only displays the <001> plot, not all three pole figures. When I use the subplot function, I see a very long list of similar warning messages in the Command window, but there are additional errors about legendcolorbarlayout and colorbar. I don't know how to interpret these warnings, either. I am stuck because I cannot begin to try and scale the contour maximum without resolving the plotting problem. Do you have any advice for me?  Here is some sample code:

Script for {100} {010} and <001> pole figures:

figure,

plotpdf(odf_kyan,[Miller(1,0,0,'hkl'),Miller(0,1,0,'hkl'),Miller(0,0,1,'uvw')]...

    ,'contourf','contours',8,'antipodal','labeled')

mtexColorMap white2black

setcolorrange('equal')

colorbar

ax = getappdata(gcf,'multiplotAxes');% removes the box around the PFs

axis(ax,'off');


Script for using subplot function to make {100} {010} and <001> pole figures:

figure,

subplot(1,3,1)

plotpdf(odf_kyan,Miller(1,0,0,'hkl'),'contourf','contours',8,'antipodal','labeled')

hold all


subplot(1,3,2)

plotpdf(odf_kyan,Miller(0,1,0,'hkl'),'contourf','contours',8,'antipodal','labeled')

 

subplot(1,3,3)

plotpdf(odf_kyan,Miller(0,0,1,'uvw'),'contourf','contours',8,'antipodal','labeled')

mtexColorMap white2black %This turns it into greyscale

hold off

setcolorrange('equal')

colorbar

ax = getappdata(gcf,'multiplotAxes');% removes the box around the PFs

axis(ax,'off');


Thank you,
--Elena Miranda
0656Area5NRKyanPFhkluvw.png

Ralf Hielscher

unread,
Oct 18, 2014, 3:27:33 PM10/18/14
to mtex...@googlegroups.com
Hi Elena Miranda,

thank you for your question. 

1. How to set contour levels

plotpdf(odf,Miller(1,0,0),'contourf',[0,1,2,3,4,5,6,7,8])

will generate exactly the specified contour levels.

2. Mixing HKL and UVW notation

[Miller(1,0,0,cs,'hkl'),Miller(0,0,1,cs,'uvw')]

is not allowed in MTEX. I should add an warning about this.

3. Mixing HKL and UVW pole figures in one figure

 Note the following code will not run in MTEX 4.0. If you are interested about the MTEX 4.0 solution ask me.

figure
ax
= subplot(1,3,1)
plotpdf
(ax,odf_kyan,Miller(1,0,0,'hkl'),'contourf',0:8,'antipodal')

ax
= subplot(1,3,2)
plotpdf
(ax,odf_kyan,Miller(0,1,0,'hkl'),'contourf',0:8,'antipodal')
 
ax
= subplot(1,3,3)
plotpdf
(ax,odf_kyan,Miller(0,0,1,'uvw'),'contourf',0:8,'antipodal')


mtexColorMap white2black
%This turns it into
greyscale

colorbar

ax
= getappdata(gcf,'multiplotAxes');% removes the box around the PFs
axis
(ax,'off');

I hope this helps,
Ralf.

Ralf Hielscher

unread,
Oct 28, 2014, 2:54:57 AM10/28/14
to mtex...@googlegroups.com
Hi Elena, hi David,

I just recognized that there is a much more simple way to mix uvw and hkl in one pole figure plot you just have to replace [ ... ] bracket by { ... } brackets, i.e.,

h = {Miller(1,0,0,'hkl'), Miller(0,1,0,'hkl'), Miller(0,0,1,'uvw')};

plotpdf
(odf_kyan,h,'contourf',0:8,'antipodal')


mtexColorMap white2black
%This turns it into
greyscale

colorbar
ax
= getappdata(gcf,'multiplotAxes');% removes the box around the PFs
axis
(ax,'off');

Ralf

Elena Miranda

unread,
Nov 16, 2014, 2:45:24 PM11/16/14
to mtex...@googlegroups.com
Hi Ralf,

Thank you very much for the solution. It works really well for me.

--Elena
Reply all
Reply to author
Forward
0 new messages