How to change the color and the fontsize in the subplots of correlation matrix by corrplot function?

조회 수: 8 (최근 30일)
Dear friends,
Please help me how to change the fontsize and color of subplots in the correlation matrix which is plotted by corrplot function?
I need a guidance in hurry!
Thanks advance!

채택된 답변

Voss
Voss 2023년 1월 10일
% use the third output (lines and histogram objects) from corrplot:
[~,~,h] = corrplot(randn(4,4))
h =
4×4 graphics array: Histogram Line Line Line Line Histogram Line Line Line Line Histogram Line Line Line Line Histogram
% get the parent axes of each line/histogram in h:
ax = get(h,'Parent');
% reshape to the same size as h:
ax = reshape([ax{:}],size(h))
ax =
4×4 Axes array: Axes Axes Axes Axes Axes Axes Axes Axes Axes Axes Axes Axes Axes Axes Axes Axes
% set some axes properties:
set(ax(3,1),'Color','g')
set(ax(2,4),'Color','y')
set(ax(4,2),'FontSize',12)
  댓글 수: 5
Khanh Dang
Khanh Dang 2023년 1월 11일
Dear Voss,
That is a very wonderful solution, it helped me solve a amount of work in the short time, MATLAB user community is great! Thank you so much, Voss.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by