필터 지우기
필터 지우기

How to change corrplot line and scatter dots properties?

조회 수: 6 (최근 30일)
dila suay
dila suay 2023년 1월 1일
댓글: dila suay 2023년 1월 3일
Hi Eveyone,
I would like to change the properties of corrplot, like linewidth or color of the dot. How can I do that?
Also, is there any way to save only 1 plot in corrplot?
Thank you

채택된 답변

Bora Eryilmaz
Bora Eryilmaz 2023년 1월 1일
편집: Bora Eryilmaz 2023년 1월 2일
Get the handle of the plot out and modify the desired properties:
[~,~,h] = corrplot(rand(100,2))
h =
2×2 graphics array: Histogram Line Line Histogram
h(1,2)
ans =
Line with properties: Color: [0 0 1] LineStyle: 'none' LineWidth: 0.5000 Marker: 'o' MarkerSize: 2 MarkerFaceColor: 'none' XData: [0.7873 0.5984 0.1201 0.1410 0.0083 0.1620 0.1182 0.1570 0.2894 0.5865 0.7984 0.4431 0.4161 0.4538 0.1486 0.1437 0.5509 0.3145 0.3455 0.3906 0.1897 0.6107 0.6898 0.6438 0.1894 0.7857 0.7490 0.6415 0.6582 0.0314 0.0351 0.4634 … ] YData: [0.2229 0.0350 0.4146 0.1456 0.0748 0.7509 0.7659 0.5506 0.1790 0.0956 0.3297 0.8241 0.6540 0.7515 0.1818 0.0070 0.3617 0.7087 0.3328 0.4187 0.6542 0.4051 0.7642 0.8023 0.5341 0.5813 0.8490 0.2850 0.8221 0.7120 0.4635 0.3704 … ] Show all properties
h(1,2).Color = 'r';
h(1,2).MarkerSize = 4;
The regression line's handle can be found as:
h(1,2).Parent.Children
ans =
3×1 graphics array: Text (corrCoefs) Line (lsLines) Line
L = h(1,2).Parent.Children(2);
L.LineWidth = 3;
  댓글 수: 4
Bora Eryilmaz
Bora Eryilmaz 2023년 1월 2일
See updated answer.
dila suay
dila suay 2023년 1월 3일
Thank you so much

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by