What is the command to change the size of the tick marks on the axes of a graph?

조회 수: 72 (최근 30일)
Bella Finkel
Bella Finkel 2015년 12월 30일
답변: Image Analyst 2015년 12월 31일
I'm trying to make a graph larger, but using the magnifying glass zoom icon just changes the size of the axes, rather than making the graph itself larger and easier to read. Is there a command or procedure that can be used to zoom in on the graph so that it becomes bigger and clearer, or one that will make the graph become bigger relative to the measurements of the axes?
  댓글 수: 3
Bella Finkel
Bella Finkel 2015년 12월 31일
편집: Bella Finkel 2015년 12월 31일
This is the figure I'm working with. I've tried zooming in on it when it's saved as a picture but it just ends up pixelated.
dpb
dpb 2015년 12월 31일
If you save it, it then is limited by whatever resolution you used when saving. Do the zooming on the graph itself by using zoom or physically setting the axis limits -- looks here like
xlim([0.17 0.19]), ylim([0.70 0.72])
would get you started by centering the area and expanding the range drastically...

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

답변 (2개)

Image Analyst
Image Analyst 2015년 12월 31일
If you want your tick to be longer and thicker, you can increase both the length AND thickness of the tick marks with the TickLength and LineWidth properties of the axes.
plot(1:10);
ax = gca;
properties(ax)
for k = .01 : 0.01 : .15
ax.TickLength = [k, k]; % Make tick marks longer.
ax.LineWidth = 100*k; % Make tick marks thicker.
message = sprintf('This tick length = %.2f', k);
uiwait(helpdlg(message));
end

Image Analyst
Image Analyst 2015년 12월 31일
It's the TickLength property. Run this demo:
plot(1:10);
ax = gca;
properties(ax)
for k = .01 : 0.01 : .15
ax.TickLength = [k, k];
message = sprintf('This tick length = %.2f', k);
uiwait(helpdlg(message));
end

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by