octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48533] "grid on" inconsistencies


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #48533] "grid on" inconsistencies
Date: Sat, 16 Jul 2016 17:08:00 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:48.0) Gecko/20100101 Firefox/48.0

URL:
  <http://savannah.gnu.org/bugs/?48533>

                 Summary: "grid on" inconsistencies
                 Project: GNU Octave
            Submitted by: mmuetzel
            Submitted on: Sat 16 Jul 2016 05:07:58 PM GMT
                Category: Plotting
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

In Matlab, "grid minor" toggles the drawing of *only* the minor grid. In
Octave, the same command also turns the major grid on. That means "grid minor"
in Octave is equivalent to "grid on, grid minor" in Matlab.

Additionally in "grid.m", there is some logic that turns the major grid off
for logarithmic axes when calling "grid on" after "grid minor". That also
seems wrong to me:

clf
semilogy (1:100)
grid minor
grid on
get (gca, 'ygrid')
ans = off


This also leads to different results when calling "grid on" twice:

clf;
semilogy (1:100);
grid on
assert (get (gca, "xgrid"), "on")
assert (get (gca, "ygrid"), "on")
assert (get (gca, "xminorgrid"), "off")
assert (get (gca, "yminorgrid"), "off") % This assert fails
grid on
assert (get (gca, "xgrid"), "on")
assert (get (gca, "ygrid"), "on") % This assert fails
assert (get (gca, "xminorgrid"), "off") % This assert fails
assert (get (gca, "yminorgrid"), "off") % This assert fails


If you do not object, I would like to re-write "grid" to closer resemble
Matlab where imho it behaves more consistently obeying the following rules:
"grid": toggle *only* major grid
"grid on": turn *only* major grid on
"grid minor": toggle *only* minor grid
"grid off": turn minor and major grid off.
"grid minor on" and "grid minor off" are not Matlab compatible. Anyway, I
would like to keep that syntax in because I see where it could be useful.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48533>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]