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
291 stars 186 forks source link

Error in plotPDF in Mtex 5.11.2 (OK in 5.11.1) #2148

Open Fred-Ad opened 5 months ago

Fred-Ad commented 5 months ago

Hi to all,

In 5.11.2 and Matlab R2020a, there's a bug with plotPDF. Here is my code :

odf = calcDensity(ebsd('indexed').orientations,'halfwidth',10*degree);
h = [Miller(0,0,0,1,ebsd.CS),Miller(-1,1,0,0,ebsd.CS),Miller(-1,2,-1,0,ebsd.CS)];
plotPDF(odf,h,'antipodal','silent');

In 5.11.1, the PDF are well plotted

In 5.11.2 there is this error related to clim :

Unrecognized function or variable 'clim'.

Error in vector3d/smooth (line 101)
    clim(sP(j).ax,colorRange);

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

Error in S2Fun/plot (line 40)
    [ch,cax] = plot(plotNodes,values(:,j),'pcolor','hold',varargin{:});

Error in S2FunHarmonicSym/plot (line 26)
[varargout{1:nargout}] = sF.plot@S2Fun(sR,sF.s,varargin{:});

Error in SO3Fun/plotPDF (line 62)
  [~,cax] = plot(pdf,'smooth','doNotDraw','ensureNonNeg',varargin{:});

Error in SO3FunHarmonic/plotPDF (line 37)
plotPDF@SO3Fun(SO3F.subSet(1),h,varargin{:});
Fred-Ad commented 5 months ago

I found it :

I replaced clim by caxis in vector3d/smooth.m.

From Matlab R2022a clim replaced caxis...

Perhaps it is possible to add a condition about Matlab version to use the good working fonction ?

ralfHielscher commented 5 months ago

Hi Fred, thank you for pointing this out. We will fix this issue in MTEX 5.11.3.

Ralf.