Error using corrplot on a matrix

Hello,
I am trying to apply correlation plot for a 45*45 matrix. But I am getting following error. Please find the matrix files attached in this thread and code below.
figure(1)
load('PSI_Test_1.mat');load('PSI_Test_2.mat');
subplot(2,2,1);corrplot(psi_result1);title('PSI_Test_1');
subplot(2,2,2);corrplot(psi_result11);title('PSI_Test_2');
% Error
% Not enough input arguments.
%
% Error in nanmean (line 7)
% N = sum(~isnan(x), dim);
%
% Error in corrplot (line 243)
% Mu = nanmean(X);

 採用された回答

Cris LaPierre
Cris LaPierre 2018 年 12 月 11 日
編集済み: Cris LaPierre 2018 年 12 月 11 日

0 投票

What version of MATLAB are you using? I see you are using 2018a while I'm using 2018b. I get a different error message.
Error using matlab.graphics.axis.Axes/set
Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf
Error in corrplot (line 280)
set(Ax(i,j),'XLim',Mu(j)+(1.1)*ZLims*Sigma(j),...
I think the one I'm getting is related to the use of the subplot command. Corrplot will automatically plot to the current axes, but it will itself create a matrix of plots. Therefore, trying to limit it to one axes in a subplot causes an error.
When I remove the subplot commands, I find the corrplot of a 45x45 matrix to be extremely taxing on the system - but it doesn't error out. When something does appear, the text labels and histograms created by corrplot obscure me from actually seeing anything, and I've not been patient enough to ever actually let my computer finish processing. You may need to reconsider your approach to actually get something you can use.

6 件のコメント

Sunny
Sunny 2018 年 12 月 11 日
Yes, that is true, I generally use imagesc so that I can see the color map so that I can distinguish between different variables in a causal matrix. I dont think correlation plot is correct for a large number of attributes. Is there any other plot like imagesc to visualize the causal matrix.
Cris LaPierre
Cris LaPierre 2018 年 12 月 11 日
Sorry, you'll have to help me a little. What is your causal matrix? Is there an example image you can share? What is it about imagesc that is not working?
Sunny
Sunny 2018 年 12 月 11 日
Causal Matric is a Correlation matric which is based on a different algorithm. The issue with imagesc is same. Its difficult to distinguish 45 rows and columns in the image. Attached image
Cris LaPierre
Cris LaPierre 2018 年 12 月 11 日
I wonder if part of the issue is the default colormap. Have you tried changing it to see if that makes your data more readable? A quick way to do this is to add a colorbar to your figure, then rt click on it and select Standard Colormaps
The best way to view the options avialable for plotting in MATLAB is to load the data to the workspace, select it, then go to the PLOTS tab. Your variable name should be visible there, along with a dropdown list of all the plot types available for visualizing that variable.
Looking at this, I'd sugges looking into pcolor, heatmap, bar3, and ribbon. Stay away from plotmatrix! It locks up MATLAB similar to what corrplot did.
Sunny
Sunny 2018 年 12 月 11 日
Great, this works. Not aware of this. Thanks
Cris LaPierre
Cris LaPierre 2018 年 12 月 11 日
There are several built-in colormaps you can set. You also have the ability to create your own if you want.

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

その他の回答 (0 件)

カテゴリ

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

製品

リリース

R2018a

質問済み:

2018 年 12 月 10 日

コメント済み:

2018 年 12 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by