gnuplot中的对数比例倒数 [英] Inversed logarithmic scale in gnuplot

查看:289
本文介绍了gnuplot中的对数比例倒数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当绘制在y的小范围内非常密集的数据时,gnuplot的对数刻度是使用的正确刻度.

When plotting data which are very dense in small ranges of y, the logarithmic scale of gnuplot is the right scale to use.

但是相反的情况下要使用什么规模?假设大多数不同曲线的y值在90到100之间.在这种情况下,我想使用反对数刻度之类的东西.我尝试使用0到1之间的对数刻度,但是gnuplot希望我选择大于1的刻度.

But what scale to use when the opposite is the case? let's say most y values of different curves are between 90 and 100. In this case I want to use something like a inversed logarithmic scale. I tried a log scale between 0 and 1 but gnuplot wants me to choose a scale greater than 1

我该如何实现?

推荐答案

是的,您可以使用对数函数的倒数,即指数函数.但是gnuplot仅支持对数刻度,因此您必须自己进行转换:

You are right, you can use the inverse of the logarithmic function, which is the exponential. But gnuplot only supports logarithmic scales, so you have to do the conversion on your own:

plot "myData" using 1:(exp($2))

您还必须自行处理轴抽动.您只需通过类似

You will also have to handle the axis tics on your own. Either you just set them via a list like

set ytics ("0" 1.00, "1" 2.72, "2" 7.39, "3" 20.09, "4" 54.60, "5" 148.41)

或者您对gnuplot 5的轴使用link功能.下面的代码使用y2axis(右y轴)绘制数据并计算右y轴上的tic.

or you use the link feature for axes of gnuplot 5. The following code uses the y2axis (right y-axis) to plot the data and calculates the tics on the left y-axis from the right one.

set link y via log(x) inverse exp(x)
plot "myData" using 1:(exp($2)) axes x1y2

侧面说明:始终记住,非线性轴很难理解.对数标度很常见,但其他所有条件都不是.因此,在显示数据时要小心

这篇关于gnuplot中的对数比例倒数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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