2
votes

Ive a data set with the below range of values,

x from 0 to 100

y from 0.0 to 10.0^10

I'm using plot function to draw the graph plot(x, y). The graph is drawn but with the below warning of converting the y values from integer to float.

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

The y values are already in float, but not sure why this warning is thrown. Is it possible to set explicit formatting(Format specifiers) on the axis or ytics ?

A similar question is posted in here. But seems like those are gnuplot commands/options. How to use the same options in octave plot ?

Edited

Code

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

Output

Resulting Graph

1
Please add a MCVE - Andy
@Andy, I've updated the post with the sample code and the resulting graph. Hope it helps. - NEB
@NEB did you ever find an answer? - Snekse
@Snekse Nope, I didn't. - NEB

1 Answers

0
votes

Is it this maybe what you are looking for? Although, having 1e10 written as 10000000000 is not very "user-friendly".

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

set format y "%.0f"

plot exp(x)

enter image description here