mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
281 stars 185 forks source link

Misorientation angle plots as percentage #169

Closed DavidMainprice closed 8 years ago

DavidMainprice commented 8 years ago

For example for two phase case

plotAngleDistribution(ebsd('Olivine').CS,ebsd('Antigorite').CS,'fundamentalRegion','percent')

987_y_uniform_misorientation_angles_ol_atg_using_plotangled

If you code your own plot ...

%**************************************************************************
%% uniform distributions - Angles & axes:  Olivine - Antigorite
%**************************************************************************
% direct calculation - uniform distributions of angles
[density,omega] = calcAngleDistribution(ebsd('Olivine').CS,ebsd('Antigorite').CS);
omega_deg = omega./degree;
frequency_percent = 100 * density ./sum(density);
[max_frequency findex]  = max(frequency_percent);
omega_at_max_ol_atg = omega_deg(findex)
frequency_at_max_ol_atg = frequency_percent(findex)
close all
figure
plot(omega_deg,frequency_percent,'b','LineWidth',2)
axis tight
xlabel('Misorientation angle in degrees','FontSize',18)
ylabel('Frequency in percent','FontSize',18)
% plot title
title('Uniform misorientation angle distribution: Olivine - Antigorite','FontSize',18)
saveFigure('987_Y_Uniform_Misorientation_angles_ol_atg.png')

987_y_uniform_misorientation_angles_ol_atg

So the MTEX

plotAngleDistribution(ebsd('Olivine').CS,ebsd('Antigorite').CS,'fundamentalRegion','percent')

frequency should be divided by some factor

all the best David

ralfHielscher commented 8 years ago

Hi David,

I would think the MTEX output is correct. The point is that in your code you divide by sum(density) but you should divide by mean(density).

Ralf.

zmichels commented 8 years ago

But the plot David showed as an example of the MTEX approach gives frequency (%) values >250%. Is that reasonable?

ralfHielscher commented 8 years ago

I think so. Ask yourself: which frequency would get a uniform distribution. I would say 100 percent.

kilir commented 8 years ago

So, in a uniform mdf/odf, the angle distribution both times is:

cs=crystalSymmetry('321')
plotAngleDistribution(uniformODF(cs,cs),'fundamentalRegion','percent')

and

plotAngleDistribution(uniformODF(cs),'fundamentalRegion','percent')

uni_mdf

So can there be actually a uniform mdf?

I think maybe calling it 'percent' in the angle distribution might be misleading as it seems to be the density relative to a uniform odf, but the uniform mdf does not have a uniform angle distribution. (?)

zmichels commented 8 years ago

Yeah. I agree that 'percent' is misleading (for me at least). I am not used to seeing a plot where the frequency (%) goes above 100% frequency. I still am not sure what that would mean for the angle distribution plot... more than 100% of the time you can expect to observe a specific angle? The plots in the mtex documentation (attached example) are like those I am used to seeing (i.e., don't go above 100%).

ralfHielscher commented 8 years ago

You may like to think about the angle distribution as an histogram with infinitely small bins. However, if you in an histogram increase the number of bin you see that them height of the bins decreases indirectly proportional with the number of bins.

If the continuous angle distribution is plotted on top of an histogram MTEX automatically scales it such that it fits to the histogram. However, if there is no histogram, one scaling has to be fixed. In statistics density distributions are always scaled such that the integral is 1. If given in percent this means that the mean value is 100.

Note also that percent is not the default scaling in MTEX.

Ralf.

DavidMainprice commented 8 years ago

Dear Ralf,

Many people use the normalisation with line integral of one, for uniform distribution line or uncorrelated line, but also the sum of histogram bins has to be one as well. However a plot that has percent scale with values greater than 100 does not make much sense to me.

If you want to remove the ‘percent’ option or encourage MTEX users to use the default option of times uniform distribution, that is not ‘percent’ that is fine. The percent scale is used by many of the commercial EBSD packages and I find it useful to compare with results published by other people using different softwares.

all the best David

Le 25 mars 2016 à 07:40, Ralf Hielscher notifications@github.com a écrit :

You may like to think about the angle distribution as an histogram with infinitely small bins. However, if you in an histogram increase the number of bin you see that them height of the bins decreases indirectly proportional with the number of bins.

If the continuous angle distribution is plotted on top of an histogram MTEX automatically scales it such that it fits to the histogram. However, if there is no histogram, one scaling has to be fixed. In statistics density distributions are always scaled such that the integral is 1. If given in percent this means that the mean value is 100.

Note also that percent is not the default scaling in MTEX.

Ralf.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/mtex-toolbox/mtex/issues/169#issuecomment-201171361