在Octave中绘制日志图

时间:2017-03-13 03:38:05

标签: matlab plot octave

我正在制作一个情节,我需要y轴以对数来正确传达它。 Log plot

我的代码正在使用semilogy(thickness, decay, "linestyle", "none", "marker", '.');绘制点,稍后会添加这一行。然后我使用ylim([0.5, e^2.5])设置y轴限制,只是使一些值看起来很好。它被正确缩放,但是y轴刻度标记,没有正确地表示y值是什么。有什么方法可以让它更精确吗?

这是我的代码:

thickness = [0.0000001, 0.3793761225,1.214276572,2.040353323,2.689048044,4.146110391,10.04557497,15.7447715,25.79869234,];
decay = [5.8784,7.146537842,6.165467626,5.636820926,5.302279485,4.375803624,2.204500978,1.337231057,0.6126601356,];
t=thickness(2:end);
d=log(decay(2:end));
p = polyfit(t,d,1);
m = p(1)
b = p(2)
gca = semilogy(thickness, decay, "linestyle", "none", "marker", '.');
hold on;
x = linspace(min(t),max(t), 100);
plot(x, e.^(m.*x+b));
title("The Radioactivity of Caesium-137");
xlabel("Thickness (mm)");
ylabel("Radioactivity Log(Becquerels)");
ylim([0.5, e^2.5])
#set(gca, 'ytick', [0,e^2]);

0 个答案:

没有答案