Math 自定义轴标度-“;反向;对数?

Math 自定义轴标度-“;反向;对数?,math,matlab,octave,Math,Matlab,Octave,很抱歉标题不好;) 我试图重新创建一个我在其他工作中遇到的matlab绘图,但我不太了解他们使用的比例。y轴增量如下(从顶部[+ve y]): 0.9999, 0.999, 0.99, 0.9, 0 我可以用符号学绘制对数图,但这是一种错误的方法;我的增量走了 一,, 0.1, 0.01, 0.001, 等 这实际上是1-i,其中i是我想要的增量!无论如何,我不完全理解如何描述这种类型的情节;有人能帮忙吗?要按您想要的方式绘制轴,您必须执行三个步骤:(1)绘制1-y,(2)反转轴(3)重新标记轴

很抱歉标题不好;)

我试图重新创建一个我在其他工作中遇到的matlab绘图,但我不太了解他们使用的比例。y轴增量如下(从顶部[+ve y]):

0.9999, 0.999, 0.99, 0.9, 0

我可以用符号学绘制对数图,但这是一种错误的方法;我的增量走了

一,, 0.1, 0.01, 0.001, 等


这实际上是1-i,其中i是我想要的增量!无论如何,我不完全理解如何描述这种类型的情节;有人能帮忙吗?

要按您想要的方式绘制轴,您必须执行三个步骤:(1)绘制1-y,(2)反转轴(3)重新标记轴

y = [0.4 0.8 0.99 0.9999];

%# plot 1-y 
plot(1-y) %# alternatively use semilog, then you won't have to adjust 'yscale' below

%# reverse y-axis
set(gca,'ydir','reverse','yscale','log')

%# if necessary, set the axis limits here

%# relabel y-axis
set(gca,'yticklabel',num2str(1-10.^str2num(get(gca,'yticklabel'))))

使用@Jonas的相同思想,我在更新版本的matplotlib中重写了代码。 假设
y=np.array([0.1,0.5,0.9,0.99,0.999])

plt.yscale('log')
plt.gca().invert_yaxis()
plt.plot(x, 1-y)
plt.gca().set_yticklabels(1-plt.gca().get_yticks())