Add tick labels in log space

조회 수: 8 (최근 30일)
Brendan
Brendan 2012년 8월 8일
I have made a plot, and set the axes to be in log space. When this happens, the tick labels become 10^1, 10^2, etc. with the exponents being superscripts. I want to add a tick mark at 40, have it display as 4*10^1, with a 1 being in the exponent (and not looking like the string '4*10^1'). How can I do this?

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 9일
편집: Azzi Abdelmalek 2012년 8월 9일
i did'nt find more then using "text" to add one tick. run this code and adapt it to your problem
t=0.1:1000;y=sin(t)./t;
close;plot(t,y);
ax1=gca;
set(ax1,'xscale','log')
ylim=get(ax1,'ylim');ymin=ylim(1);ymax=ylim(2);
yd=ymax-ymin;
text(4*10,ymin-abs(yd)/40,'4*10^2')
line([40 40],[ymin ymin+abs(yd)/40])
%in this case, the added tick can be ajustable manualy

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by