필터 지우기
필터 지우기

How can I prevent BigAx and AX xlabels from overlapping when using plotmatrix?

조회 수: 3 (최근 30일)
Emma Rudziensky
Emma Rudziensky 2022년 3월 2일
답변: Shivam 2023년 9월 28일
Hello,
I am using the plotmatrix function to plot every column of 'R*exp' and 'T_Ta' against one another. I have assigned xlabels and ylabels to both the subplot axes (AX) and the overall axes (BigAx). However, the xlabels for the two axes overlap one another.
[S,AX,BigAx,H,HAx] = plotmatrix(R*exp,T_Ta);
xlabel("RFDA Integral Values (x 10^{-5} V*s)")
AX(3,1).XLabel.String='Ch 1';
AX(3,2).XLabel.String='Ch 2';
AX(3,3).XLabel.String='Ch 3';
AX(3,4).XLabel.String='Ch 4';
AX(3,5).XLabel.String='Ch 5';
ylabel("Transfer Curve Parameters")
AX(1,1).YLabel.String='a';
AX(2,1).YLabel.String='b';
AX(3,1).YLabel.String='c';
title('Tantalum')
I want the xlabels to look just like the ylabels, where the subplot label is nearest the axis and the overall axis label is outside of that.
I tried changing the Position property of the BigAx label to move it downward by a small amount (code below), but the label disappears every time I make an adjustment-- regardless of how small the adjustment is or in what direction I try to move the label.
defaultLocation=BigAx.XLabel.Position(2); %get the y-coordinate of the XLabel's position
newLocation=defaultLocation-0.10*defaultLocation; %determine a more favorable position
BigAx.XLabel.Position(2)=newLocation; %assign the more favorable positoin
I would prefer to prevent this overlap in the first place but am also interested simple fixes for it like that attempted above.
Thank you!
Emma

답변 (1개)

Shivam
Shivam 2023년 9월 28일
From the information you have provided, I understand that plotting the columns of "R*exp" and "T_Ta" using the "plotmatrix" function is giving the overlapped XLabel of subplot axes and overall axes. Also, adjusting the XLabel of overall axes to 10%(0.10) down is making the XLabel go out of the figure.
In order to maintain a suitable distance between XLabel of subplot axes and overall axes, replace 0.10 with 0.05 in the calculation.
newLocation = defaultLocation - 0.05*defaultLocation;
I hope it helps.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by