scatterhist problem 'color value must be a 3 element vector'

rng default % For reproducibility
p1 = pearsrnd(0,1,-1,4,1000,1);
p2 = pearsrnd(0,1,0.75,3,1000,1);
figure
scatterhist(p1,p2)
It gives me:
Error using matlab.graphics.chart.primitive.Histogram/set
While setting the 'FaceColor' property of Histogram:
Color value must be a 3 element vector
Error in internal.stats.plotGroupedHist (line 130)
set(hXLines(i),'FaceColor',clr(i,:));
Error in
scatterhist>@()internal.stats.plotGroupedHist(x,grp,'NBins',xbin,'Color',clr,'DisplayStyle',style,'Norm','pdf','AxisOn',false,'PlotGroup',plotGroup)
(line 299)
Xfunc = @()internal.stats.plotGroupedHist(x,grp,'NBins',xbin,...
Error in scatterhist (line 384)
Xfunc();
WHY? How can I solve?

9 件のコメント

George
George 2016 年 10 月 11 日
It works for me. Can you post the output of
which -all scatterhist
condor
condor 2016 年 10 月 11 日
C:\Program Files\MATLAB\MATLAB Production Server\R2015a\toolbox\stats\stats\scatterhist.m
George
George 2016 年 10 月 11 日
Do you know why that's in a MATLAB production server subdirectory? Mine is just in the stats toolbox directory.
condor
condor 2016 年 10 月 11 日
I don't know ... but everything has always worked perfectly!
Do you think this may be the problem?
Walter Roberson
Walter Roberson 2016 年 10 月 11 日
I have seen an increase over the last few months in the number of installations showing up as MATLAB Production Server . It probably makes no difference.
Walter Roberson
Walter Roberson 2016 年 10 月 11 日
Please check
which lines
The expected location is toolbox/matlab/graph3d/lines.m
condor
condor 2016 年 10 月 12 日
no I have another one ... this: >> which lines C:\Users\mauro\Desktop\MATLAB\MATLAB_Generale\PERIZIE\Anatocismo\OCR\lines.m
Walter Roberson
Walter Roberson 2016 年 10 月 13 日
condor, you need to do one of the following:
  1. delete C:\Users\mauro\Desktop\MATLAB\MATLAB_Generale\PERIZIE\Anatocismo\OCR\lines.m -- which would probably interfere with using that software
  2. rename that file to something else -- which would probably interfere with using that software unless you edited all of the code in that package to use a different name
  3. use pathtool to move that OCR directory to below the Mathworks-supplied directories -- which would probably interfere with using that software
  4. use pathtool to remove the OCR directory for you MATLAB path -- this would require that you cd to that directory to run the software
  5. create a subdirectory named private in C:\Users\mauro\Desktop\MATLAB\MATLAB_Generale\PERIZIE\Anatocismo\OCR and move the lines.m file to that subdirectory. In theory that should allow that software to work without changing anything else
condor
condor 2016 年 10 月 13 日
編集済み: condor 2016 年 10 月 13 日
Genius! Thanks Walter!!! PS How do I select your answer?

サインインしてコメントする。

 採用された回答

Walter Roberson
Walter Roberson 2016 年 10 月 13 日

0 投票

condor, you need to do one of the following:
  1. delete C:\Users\mauro\Desktop\MATLAB\MATLAB_Generale\PERIZIE\Anatocismo\OCR\lines.m -- which would probably interfere with using that software
  2. rename that file to something else -- which would probably interfere with using that software unless you edited all of the code in that package to use a different name
  3. use pathtool to move that OCR directory to below the Mathworks-supplied directories -- which would probably interfere with using that software
  4. use pathtool to remove the OCR directory for you MATLAB path -- this would require that you cd to that directory to run the software
  5. create a subdirectory named private in C:\Users\mauro\Desktop\MATLAB\MATLAB_Generale\PERIZIE\Anatocismo\OCR and move the lines.m file to that subdirectory. In theory that should allow that software to work without changing anything else

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

質問済み:

2016 年 10 月 11 日

回答済み:

2016 年 10 月 13 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by