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
286 stars 185 forks source link

Issue with `colorrange` #1608

Open AmitS07 opened 2 years ago

AmitS07 commented 2 years ago

What do you want to do? I want to plot the pole figure with customize MRD scale What data do you have? I did use `colorrange' command in the plotPDF option to do the same. I am able to do that, but the plots look very much bizarre. See the plots below What code do you use? The script is here

%% code to plot Texture form orientation file%%
CS = crystalSymmetry('hexagonal');
SS = specimenSymmetry('monoclinic');
pf = readmatrix('caxis_1000text.txt'); 
ori = loadOrientation_generic(pf,'CS',CS,'SS',SS, 'ColumnNames', ...
{'Euler1' 'Euler2' 'Euler3'},'Columns',[1,2,3],'Bunge');
odf = calcDensity(ori);
% PF plot
h = Miller({0,0,0,1},ori.CS);
plotPDF(odf,h, 'projection', 'eangle','antipodal', 'false','contourf','colorrange',[0 30],'complete', 'upper')  % 'colorRange','equal' for only on ecolor map
mtexColorMap('viridis')
mtexColorbar
figure()

What result do you get

  1. PF plots with colorrange 1000_grain_text_fodf_pf2

  2. PF plots without colorrange 1000_grain_text_fodf_pf What result do you expect

Error Message There was not any error message

What MTEX version do you use? MTEX 5.8.1

kilir commented 1 year ago

Hi Amit, from the density estimation, you get very small fluctuations around 0. If you choose to set the first contour at exactly 0, you will see those. If you add 'minmax' you get an idea how below 0 those might be.

Cheers, Rüdiger

AmitS07 commented 1 year ago

Hello Dr. Rudiger,

Thanks for reply. I tried with minmax , but issue still remains the same. My doubt is, while I am able to see those discrete contours? With minmax I am able to see the lower and upper bound of MRD/desnity scale. I also tried to plot directly from ori, with out odf calculation and the results are as shown below. I mean the problem remains the same. The script to plot pf is this:

CS = crystalSymmetry('hexagonal'); SS = specimenSymmetry('monoclinic'); pf = readmatrix('caxis_1000text.txt'); %pf = normalize(pf) : I think higher mrd might be due to normalization of the poles/orientations ori = loadOrientation_generic(pf,'CS',CS,'SS',SS, 'ColumnNames', ... {'Euler1' 'Euler2' 'Euler3'},'Columns',[1,2,3],'Bunge', 'halfwidth',10*degree); h = Miller({0,0,0,1},ori.CS); plotPDF(ori,h, 'projection', 'eangle','antipodal', 'false', 'contourf','complete', 'upper','colorrange',[0 60]) mtexColorMap('viridis') mtexColorbar

1000_grain_text_fori_pf2

kilir commented 1 year ago

Since your texture is very sharp, using a small kernel is somewhat appropriate. Hence it's also difficult to omit those insignificant negative values. If you don't want to see them, you could set the poition of your smallest contour differently e.g smaller or larger. Cheers, Rüdiger