如何在Gnuplot中使用非线性轴?

酒吧Khairullin

我看到了一些这样的例子:

f(x) = log10(x)
g(x) = 10**x
set nonlinear x via f(x) inverse g(x)

因此,这等效于对数缩放x。
但是我不明白为什么我们需要编写逆函数?我也有这种情况:

For data in x>=0 range I need to scale x in a way that it shows in an almost-half plot;
For data in -100<=x<0 I need to scale x in a way that it shows in a small part of plot;
For data in x<-100 I need to scale x in a way as for data in x>=0.

假设我们有一张a4paper,gnuplot在上面创建了他的图。我想有一个将以x比例绘制的绘图结果:

If x>=0 1cm = 5 
If -100<=x<0 1cm = 100
If x<-100 1cm = 5

(我并不是说只有这个厘米对我很重要,它只是说我需要两个x值的增量与它们之间的实际长度之间的相关性。)

很抱歉,我无法理解这种扩展机制。

伊森

前进功能告诉gnuplot在页面上的哪个位置绘制用户坐标[x,y]。将该位置称为[x',y']。为此仅需要转发功能。但是交互式终端回显鼠标的位置,并允许您出于各种目的单击图。为了知道鼠标单击[x',y']的含义,程序必须将其转换回原始的[x,y]。为此,它需要逆函数。

有关在整个图的不同部分上使用不同缩放函数的示例,请参见下面的在线演示非线性1.dem。

# This example shows how a nonlinear axis definition can be used to 
# create a "broken axis". X coordinates 0-100 are at the left,
# X coordinates 500-1000 are at the right, there is a small gap between them.
# So long as no data points with (100 < x < 500) are plotted, this works as expected.
#
# f(x) maps x axis (discontinuous) to shadow axis coords (continuous linear range [0:1000])
# g(x) maps shadow axis coords to x axis readout
# 
  set title "A 'broken' x axis can be defined using 'set nonlinear x'"

# Define the broken-axis mapping
  axis_gap = 25.
  f(x) = (x <= 100) ? x : (x < 500) ? NaN : (x - 400 + axis_gap)
  g(x) = (x <= 100) ? x : (x < 100 + axis_gap) ? NaN : (x + 400 - axis_gap)
  set xrange [15:600] noextend
  set nonlinear x via f(x) inverse g(x)

  set xtics 50.
  set xtics rotate by -90 nomirror
  set ytics nomirror
  set border 3
  unset key

# Creation of the broken axis marks (this should be automated)
  set arrow 500 from 100, graph 0 to 500, graph 0 nohead lt 500 lw 2 lc bgnd front
  set arrow 501 from 100, graph 0 length graph  .01 angle 75 nohead lw 2 front
  set arrow 502 from 100, graph 0 length graph -.01 angle 75 nohead lw 2 front
  set arrow 503 from 500, graph 0 length graph  .01 angle 75 nohead lw 2 front
  set arrow 504 from 500, graph 0 length graph -.01 angle 75 nohead lw 2 front

  plot 'silver.dat' with yerrorbars lw 2, '' with lines

在此处输入图片说明

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何在绘图中创建非线性轴

来自分类Dev

如何在Matlab中使用Jacobian和Newton方法求解(非线性)方程组

来自分类Dev

如何在python中使用for循环求解非线性方程?

来自分类Dev

如何在插入符号中使用 stats::nls 非线性最小二乘回归?

来自分类Dev

如何在Matlab中使用非线性最小二乘法求解超定方程组

来自分类Dev

在VHDL中使用非线性查找操作

来自分类Dev

如何使用Matplotlib绘制具有非线性x轴刻度的曲线?

来自分类Dev

gnuplot:如何设置自定义非线性比例

来自分类Dev

如何使用matplotlib绘制非线性函数?

来自分类Dev

如何使用matplotlib绘制非线性模型?

来自分类Dev

Matlab中的线性和非线性轴

来自分类Dev

在Scikit-Learn中使用非线性SVM时出错

来自分类Dev

在TensorFlow中使用ReLU建立非线性模型

来自分类Dev

如何在gnuplot中使用Floor功能

来自分类Dev

如何在Matlab中求解非线性约束优化?

来自分类Dev

如何在Highcharts上的yAxis中设置非线性步长

来自分类Dev

如何在Matlab中创建非线性间隔矢量?

来自分类Dev

如何在Matplotlib中创建非线性颜色条刻度

来自分类Dev

如何在python中优化非线性方程?

来自分类Dev

如何在Python中解决非线性系统

来自分类Dev

如何在R中求解非线性方程

来自分类Dev

如何在Matlab中求解非线性约束优化?

来自分类Dev

如何在Highcharts上的yAxis中设置非线性步长

来自分类Dev

如何在 R 中拟合非线性线?

来自分类Dev

Matplotlib中的非线性第二轴

来自分类Dev

非线性图表Y轴EXCEL

来自分类Dev

如何在Gnuplot中以编程方式使用轴?

来自分类Dev

如何使用python求解非线性方程

来自分类Dev

如何填充非线性树

Related 相关文章

热门标签

归档