在轴上缩放值/标签

时间:2019-07-07 04:14:28

标签: gnuplot octave

具有一个具有以下值范围的数据集,

x from 0 to 100

y from 0.0 to 10.0^10

我正在使用plot函数绘制图形plot(x, y)。该图形已绘制,但带有以下警告,即将y值从整数转换为浮点数。

multiplot> set ytics in scale  1.4 border mirror ( "0" 0,  "1e+10" 10000000000,  "2e+10" 20000000000,  "3e+10" 30000000000,  "4e+10" 40000000000,  "5e+10" 50000000000,  "6e+10" 60000000000,  "7e+10" 70000000000) textcolor rgb "#262626" font ",10";
line 2: warning: integer overflow; changing to floating point

y值已经处于浮动状态,但是不确定为什么会引发此警告。是否可以在axisytics上设置显式格式设置(Format specifiers)?

一个类似的问题发布在here中。但是似乎这些是gnuplot命令/选项。如何在八度plot中使用相同的选项?

已编辑

代码

> 
> 
> x = round(rand(10)(1,:) .* 100)
x =

   76   13   11   79   72   78   36    8   21   63

> y = rand(10)(1,:) .* 1e+10
y =

   5836992276.93708   6471394539.45494   7847697654.87665   2495557143.74836   2694348406.60242   9736785473.26907    756349861.48275   9948115214.16169   4768610059.59765   6621668613.33630

> plot(x,y)

multiplot> set ytics in scale  1.4 border mirror ( "0" 0,  "2e+09" 2000000000,  "4e+09" 4000000000,  "6e+09" 6000000000,  "8e+09" 8000000000,  "1e+10" 10000000000) textcolor rgb "#262626" font ",10";
                                                                                        ^
           line 0: warning: integer overflow; changing to floating point

multiplot> set ytics in scale  1.4 border mirror ( "0" 0,  "2e+09" 2000000000,  "4e+09" 4000000000,  "6e+09" 6000000000,  "8e+09" 8000000000,  "1e+10" 10000000000) textcolor rgb "#262626" font ",10";
                                                                                                             ^
           line 0: warning: integer overflow; changing to floating point

multiplot> set ytics in scale  1.4 border mirror ( "0" 0,  "2e+09" 2000000000,  "4e+09" 4000000000,  "6e+09" 6000000000,  "8e+09" 8000000000,  "1e+10" 10000000000) textcolor rgb "#262626" font ",10";
                                                                                                                                  ^
           line 0: warning: integer overflow; changing to floating point

multiplot> set ytics in scale  1.4 border mirror ( "0" 0,  "2e+09" 2000000000,  "4e+09" 4000000000,  "6e+09" 6000000000,  "8e+09" 8000000000,  "1e+10" 10000000000) textcolor rgb "#262626" font ",10";
                                                                                                                                                       ^
           line 0: warning: integer overflow; changing to floating point

multiplot> set ytics in scale  1.4 border mirror ( "0" 0,  "2e+09" 2000000000,  "4e+09" 4000000000,  "6e+09" 6000000000,  "8e+09" 8000000000,  "1e+10" 10000000000) textcolor rgb "#262626" font ",10";
                                                                                        ^
           line 0: warning: integer overflow; changing to floating point

multiplot> set ytics in scale  1.4 border mirror ( "0" 0,  "2e+09" 2000000000,  "4e+09" 4000000000,  "6e+09" 6000000000,  "8e+09" 8000000000,  "1e+10" 10000000000) textcolor rgb "#262626" font ",10";
                                                                                                             ^
           line 0: warning: integer overflow; changing to floating point

multiplot> set ytics in scale  1.4 border mirror ( "0" 0,  "2e+09" 2000000000,  "4e+09" 4000000000,  "6e+09" 6000000000,  "8e+09" 8000000000,  "1e+10" 10000000000) textcolor rgb "#262626" font ",10";
                                                                                                                                  ^
           line 0: warning: integer overflow; changing to floating point

multiplot> set ytics in scale  1.4 border mirror ( "0" 0,  "2e+09" 2000000000,  "4e+09" 4000000000,  "6e+09" 6000000000,  "8e+09" 8000000000,  "1e+10" 10000000000) textcolor rgb "#262626" font ",10";
                                                                                                                                                       ^
           line 0: warning: integer overflow; changing to floating point
> 
> 
> 

输出

Resulting Graph

1 个答案:

答案 0 :(得分:0)

这也许就是您想要的吗?尽管将1e10编写为10000000000并不是很“用户友好”。

set xrange[0:100]
set yrange[0:1e10]

set format y "%.0f"

plot exp(x)

enter image description here