#165 yrange reverses in map

closed-fixed
None
5
2004-05-04
2004-05-03
Tommaso Vinci
No

Hello,

this is the simplest script where I found the bug

set view map
set yrange [0:2]
splot x*y with l
pause -1
set yrange [0:2]
replot
pause -1

What appens is that on first plot yrange goes from 0 to 2
and on the second plot it reverses going from 2 to 0

I didn't see it before version 4 (99% of sureness)

thank you!

Discussion

  • Tommaso Vinci
    Tommaso Vinci
    2004-05-04

    Logged In: YES
    user_id=982217

    I've put my dirty hands on the CVS code and after a lot of
    time I've found this line in axis.c (line 1429)

    axis\_array\[axis\].range\_flags &= ~RANGE\_REVERSE;
    

    If I take out the "~" everything seems to work.

    What do you think?!?

    many thanks

     
  • Logged In: YES
    user_id=27517

    Looks like the change that broke it was this one, then:

    /* HBB 20040315: ... and clear it automatically if a
    fixed range
    * was given the "right" way round! */

    Apparently, this conflicts with 'set view' map and its
    kludgy way of getting an splot to look like a 2D plot.

     
  • Logged In: NO

    I've gone deeper (like digging 10 meter to reach the earth
    center!!)

    and I've changed the
    #define RANGE_REVERSE 1
    at line 192 of axis.h

    Could someone explaine why it was set to 2?
    which is the meaning of RANGE REVERSE?

    now it works leaving untouched the line in axis.c (line
    1429) as this:
    axis_array[axis].range_flags &= ~RANGE_REVERSE;

    but I have to make more debug...

    thanks

     
  • Logged In: YES
    user_id=27517

    That "fix" is even more dangerous than the one you came up
    with before. Pardon the French, but I don't think you know
    what you're doing there. You've just killed an entire
    gnuplot feature just to fix a (relatively) minor bug.

    The real problem is not in either of the places you've found
    so far, but in the way 'set view map' does its work.

     
  • Tommaso Vinci
    Tommaso Vinci
    2004-05-04

    Logged In: YES
    user_id=982217

    Ok, I've noticed.....
    I'll take a deep breath an stop doing junk things...

    now I'll take a time to look at source... and learn something

    thanks

     
  • Petr Mikulik
    Petr Mikulik
    2004-05-04

     
    Attachments
  • Petr Mikulik
    Petr Mikulik
    2004-05-04

    Logged In: YES
    user_id=31505

    Oh, that's deep in and because of mousing ... and probably
    will be for some time until *ranges in the current gnuplot
    session* and *ranges in the last plot* are separated into an
    appropriate structure, like it was in the mousing version in
    1998.

    My patch is a workaround which fixes your "set yrange
    [0:2]", but fails for "set yrange [2:0]" -- but that's less
    frequent I guess and you can still do "set yrange [0:2]
    reverse" anyway.

    Please try the patch, or improve if not working.

     
  • Logged In: YES
    user_id=27517

    Petr: your patch has a serious bug in the "pop" part of your
    PUSH_POP function: it'll kill bit #0 (value 1) of range_flags.

    I think it'ld make more sense to call splot_map_deactivate()
    at the start of set_range(), and splot_map_activate() at the
    end of it, instead.

    Either that, or we need to split up "range_flags" into a
    "set_range_flags" and "current_range_flags", just as min and
    max are currently handled in struct axis.

     
  • Petr Mikulik
    Petr Mikulik
    2004-05-04

    Logged In: YES
    user_id=31505

    Then it should be changed to

    int map_is_active = get ... ();
    if (map_is...) deactivate();
    ...
    if (map_is) activate();

    Please try it. I cannot do more till Thursday.

     
  • Logged In: YES
    user_id=27517

    Fixed in CVS.

     
    • assigned_to: nobody --> broeker
    • status: open --> closed-fixed