Menu

#692 error when not specifying positive yrange for logscale

closed-invalid
nobody
2D plot (258)
3
2008-09-15
2008-09-15
No

gnuplot complains: "y range must be greater than 0 for log scale" unless I explicitly give a yrange through "set yrange ..." or "plot [xrange] [yrange] .." which starts at >= 0. Why is that? I think I should also able to specify e.g. [-1000:1000] ?!

happens in v4.23 and v4.3, e.g. with the following:

set logscale y
#set yrange [0.1:120]

plot "callsPerType.data" using 1:2 @axes1 title "blabla" @styleLines

Discussion

  • Ethan Merritt

    Ethan Merritt - 2008-09-15

    Log(0) is negative infinity, so it cannot be shown on a finite axis.

     
  • Ethan Merritt

    Ethan Merritt - 2008-09-15
    • status: open --> closed-invalid
     
  • Volker Badziong

    Volker Badziong - 2008-09-15

    I am sorry, but I do not understand.

    These paramters (set logscale / yrange) are for specifying the type of scaling (linear/logarithmic) as well as the interval of y-axis which is supposed to be shown/drawn. I do understand that log(0) and log() of negative numbers are not defined. But this is not what the user is concerned about. The user just what the SCALING of the axis to be logarithmic.

    For the pure purpose of visualization, why not just define log(0):= 0 and log(-x):=-(log(x))?

    Asked differently: What is the suggested why to achieve the mentioned logarithmic drawing of values [-1000:1000] in gnuplot?

     
  • Volker Badziong

    Volker Badziong - 2008-09-15
    • priority: 5 --> 3
    • status: closed-invalid --> open-invalid
     
  • Ethan Merritt

    Ethan Merritt - 2008-09-15

    Try the experiment:

    set yrange [1:1000]; set log y; plot x
    set yrange [0.1:1000]; set log y; plot x
    set yrange [0.01:1000]; set log y; plot x
    set yrange [0.001:1000]; set log y; plot x

    You will quickly see why no finite log-scale axis can contain 0.

     
  • Ethan Merritt

    Ethan Merritt - 2008-09-15
    • status: open-invalid --> closed-invalid
     
  • Volker Badziong

    Volker Badziong - 2008-09-15
    • status: closed-invalid --> open-invalid
     
  • Volker Badziong

    Volker Badziong - 2008-09-15

    I am sorry, I think I see what you are trying to show me, that log(0) is not defined. (as well as for negative numbers). This is not my concern. Could you please comment on that the user just wants the SCALING of the axis to be logarithmic? I think you agree that it is possible to do so?

    Asked differently: What is the suggested way to achieve the mentioned
    logarithmic drawing of values [-1000:1000] in gnuplot? Maybe you have just datapoints distributed this way and you just want not linear scale?

    Maybe take it as a feature request?!

     
  • Ethan Merritt

    Ethan Merritt - 2008-09-15

    > I think you agree that it is possible to do so?
    No, it is not.

    > What is the suggested way to achieve the mentioned
    > logarithmic drawing of values [-1000:1000]
    It is not possible. Really. Please think about this some more before continuing to ask for the impossible. This has nothing to do with gnuplot; it's just basic maths.

     
  • Ethan Merritt

    Ethan Merritt - 2008-09-15
    • status: open-invalid --> closed-invalid
     
  • Volker Badziong

    Volker Badziong - 2008-09-16

    Hi,
    I thought about what you were saying and I see the problem: Of course you need to know the number of powers and also either the minimum or maximum of the range to adjust your scaling. In my case I was dealing with integers so I intuitively had in mind the lower bound of 1. So far so good, you could tell gnuplot [1:max]. But what about if there are also negative numbers, lets say also integers, distributed in the same way that you would like them visualized on a logarithmic scale. So could we have a valid range, lets say [-1000:-1]? What would you have to do currently in gnuplot to visualize negative values in [-1000:-1] on a logarithmic scale?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.