如何在 gnuplot 中的轴上以 2 个不同的比例进行绘图
我想在 x 轴范围 [0:1] 和 y 轴范围 [0:100] 上绘制一些数据,但在 x 轴上,我的大部分数据在 [0:0.1] 范围内,其余数据较少范围。因此我想扩大 [0:0.1] 范围。我无法对 x 轴使用对数刻度,因为我有一些数据为 0,如果使用对数刻度,则无法绘制它。有没有办法在 Gnuplot 中绘制它?
理想情况下,我想对 x 轴应用对数刻度,但从 0 开始绘图。这将帮助我覆盖所有数据并突出显示 [0:0.1] 范围。能做到吗?
I want to plot some data on x axis range [0:1] and y axis range [0:100], but on the x axis I have most of my data in range [0:0.1] and less data in the rest of the range. I thus wanted to expand the [0:0.1] range. I cannot use a logarithmic scale for the x axis as I have some data which is 0 and I cannot plot it if I use a logarithmic scale. Is there a way for plotting this in Gnuplot?
Ideally I would want to apply a logarithmic scale to the x axis, but start my plot from 0. That would help me to cover all the data and highlight the [0:0.1] range as well. Can it be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如您所指出的,不可能有 0 的对数刻度。我会并排使用两个图表,并具有单独的 x 轴。您可以通过
设置多图布局 1,2
来完成此操作。As you noted, it is impossible to have a logarithmic scale with a 0. I would use two graphs side by side, with separate x axes. You can do this through
set multiplot layout 1,2
.我同意斯万特的观点。另一种选择是在同一图中引入第二个 x 轴。然后,一个 x 轴将从 0:0.1 开始缩放,另一个 x 轴将从 0:1 开始缩放。 取决于您的数据,但是这种方法可能会非常令人困惑,但我认为特别是如果您的数据主要位于 0:0.1 之间,这可能会起作用。
I agree with Svante. An other option would be to introduce a second x-axis in the same plot. Then one x-axis would scale from 0:0.1 and the other would scale from 0:1. Depending on your data however this approach could be very confusing but I think especially if your data is primarily located between 0:0.1 this could work.