自定义轴刻度-“反向"刻度对数的? [英] Custom axis scales - "Reverse" logarithmic?

查看:111
本文介绍了自定义轴刻度-“反向"刻度对数的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,标题不好;)

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

I'm trying to recreate a matlab plot I've come across in some other work, but I don't quite understand the scale they are using. The y axis increments are as follows (from the top [+ve y]):

0.9999, 0.999, 0.99, 0.9, 0

0.9999, 0.999, 0.99, 0.9, 0

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

I can use semilogy to plot a logarithmic graph, but this is kind of the wrong way round; my increments go

1, 0.1, 0.01, 0.001, 等等

1, 0.1, 0.01, 0.001, etc

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

which is actually 1 - i, where i is the increments I actually want! I don't entirely understand how to describe this type of plot anyway; can anyone help?

推荐答案

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

To plot the axes the way you want to, you have to do three steps: (1) plot 1-y, (2) reverse axes (3) relabel axes

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'))))

这篇关于自定义轴刻度-“反向"刻度对数的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆