How can I prevent BigAx and AX xlabels from overlapping when using plotmatrix?
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!