Menu

#2783 If "set link" is given, gnuplot should warn or barf if impossible constraints are given

None
open-not-a-bug
nobody
None
2025-04-08
2025-03-31
dima
No

Hi. Today I can ask for this:

set yrange reverse
set y2range noreverse
set link y2 via y inverse y

Here I link y,y2 (to be equivalent). And I ask for a reversed y axis and a non-reversed y2 axis. This is impossible, but gnuplot doesn't complain, so unexpected things can happen in this situation. Can gnuplot warn or barf when given this? I think reasonable logic would be "if we have 'set link y2' then we can have 'set yrange' or 'set y2range', but not both".

Thanks

Discussion

  • Ethan Merritt

    Ethan Merritt - 2025-04-07
    • status: open --> open-not-a-bug
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2025-04-07

    "set link" overrides previous settings and ranges. No error. That's just the way it is.

     
  • dima

    dima - 2025-04-08

    Hi. I don't think this is the case. I have this script:

    set yrange [10:0]
    set y2range [0:10]
    set link y2 via y inverse y
    set y2tics
    plot x

    If I remove one of "set yrange/y2range" commands, then the remaining one IS respected, despite the "set link" coming after. I.e. the "set link" doesn't override the existing setting. If I leave both "set yrange/y2range" in there, it's impossible to respect them both, and the "set y2range" is ignored.

     
    • Ethan Merritt

      Ethan Merritt - 2025-04-08

      I should better have said "set link keeps the current range of the primary axis, overriding whatever was previously in the secondary axis". Once the link is in place, autoscaling on either the primary or secondary axis affects both.

       

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.