Increase only the axes line width and not the grid line-width

조회 수: 72 (최근 30일)
Leo Quintanar
Leo Quintanar 2018년 1월 25일
댓글: Lhoussine BENTAYFASTE 2020년 3월 24일
Hello, I having problems adjusting just the line-width of the axes in my surface. the only code I've seen is
set(gca,'linewidth', 2,'fontsize',60,'fontname','Times New Roman') % Sets the width of the axis lines, font size, font
here is my relevant code:
s2 = surf(EnergyAlpha, TimeDelayAlpha, AbsorbanceChangeAlpha); % Creates a surfurace of the values in the postive quadraunt of the x,y,z
hold
s1 = surf(EnergyBeta, TimeDelayBeta, AbsorbanceChangeBeta); % Creates a surfurace of the values in the negativ quadraunt of the x,y,z
% Use this for WS2image and PerovskiteImage
%xlim([1.8 2.7]); % Limist the x axis
%ylim([-1.4 100]); % Limist the y axis
%zlim([-3.7 4.3]); % Limist the z axis
% Use this for WS2-Perovskite-image
xlim([1.8 2.7]); % Limist the x axis
ylim([-1.4 100]); % Limist the y axis
zlim([-2 5.8]); % Limist the z axis
colorbar('Position', [0.95 0.1 0.01 0.7])
az = 220;
el = 30;
view(az, el);
%title(fileName, 'fontsize',25) % Title label
%xlabel('Photon Energy (eV)', 'fontsize',20) % x-axis label
%ylabel('Time-Delay (ps)', 'fontsize',20) % y-axis label
%zlabel('Absorbance Change', 'fontsize',20) % z-axis label
get(gca,'fontname') % shows you what you are using.
set(gca,'linewidth', 2,'fontsize',60,'fontname','Times New Roman') % Sets the width of the axis lines, font size, font
shading interp
and here is a picture of my surface:
  댓글 수: 2
Jan
Jan 2018년 1월 25일
What exactly is the "axes line width"? Do you mean the 3 black lines in X, Y and Z direction?
Leo Quintanar
Leo Quintanar 2018년 1월 25일
yes how to make the x, y and, z

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

답변 (2개)

Walter Roberson
Walter Roberson 2018년 1월 25일
There is an undocumented property you can use:
ax = gca;
ax.XRuler.Axle.LineWidth = 2;
  댓글 수: 1
Lhoussine BENTAYFASTE
Lhoussine BENTAYFASTE 2020년 3월 24일
thank you verry much
that's working perfectly
i was looking about it for a long time
thanks again

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


Star Strider
Star Strider 2018년 1월 25일
The only way I know to do that is to overplot the axes lines using plot3 (or plot in 2D).
Try this:
[X,Y,Z] = peaks;
figure(1)
surf(X,Y,Z)
xl = xlim;
yl = ylim;
zl = zlim;
hold on
plot3(xl,[1 1]*yl(1),[1 1]*zl(1), 'k', 'LineWidth',2)
plot3([1 1]*xl(1),yl,[1 1]*zl(1), 'k', 'LineWidth',2)
plot3([1 1]*xl(1),[1 1]*yl(2),zl, 'k', 'LineWidth',2)
hold off
grid on
If you rotate the plot significantly, you will need to re-plot the wider axis lines.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by