bugGNU Octave - Bugs: bug #48528, minor grid should be drawn on...

 
 

bug #48528: minor grid should be drawn on major ticks if major grid is off

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Fri 15 Jul 2016 06:26:45 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 22 Aug 2016 01:07:12 AM UTC, comment #10: 

Minor grid is now drawn correctly at major locations.  Closing report.

Rik <rik5>
Group administrator
Sat 20 Aug 2016 01:29:29 PM UTC, comment #9: 

I've pushed the part which draws the major grid if minor grid is on here:
http://hg.savannah.gnu.org/hgweb/octave/rev/9deb86bb5632

But not the demos and tests. I think demos shouldn't contain referenced to bugs and the tests in your patch should go to the commit which fixes bug #48533.

Andreas Weber <andy1978>
Group Member
Sat 16 Jul 2016 05:17:28 PM UTC, comment #8: 

Dan, attached please find the updated changeset that also adds the demos and tests to "grid.m".

I also filed the new bug #48533 to track the inconsistent result of "grid".

(file #37914)

Markus Mützel <mmuetzel>
Group administrator
Sat 16 Jul 2016 03:58:16 PM UTC, comment #7: 

Sorry, Dan, this was a misunderstanding on my side. I thought you wanted some manual tests.

I will file another bug report on the issues in the first verbatim-block of comment #5 and add the demos and some generalized (failing) tests in "grid.m" here as soon as I have it ready.

Markus Mützel <mmuetzel>
Group administrator
Sat 16 Jul 2016 07:07:43 AM UTC, comment #6: 

The demos look good, illustrating the various combinations.  I'm having a bit of trouble following them with the related bugs in the mix, but it appears that you placed some assert() tests in there to show that the result is not as expected.  So, if these are run during the check phase they'll come up as failed tests and will motivate someone to fix them.

The demos should be placed within the file having the name of the test.  So, for "demo grid", look to the end of the file "grid.m" and you should see how to format the demos.


%!demo
%! subplot (1,2,1)
%!  plot (1:10);
%!  set (gca, 'xminorgrid', 'on')
%!  set (gca, 'yminorgrid', 'on')
%! subplot (1,2,2)
%!  semilogy (1:100);
%!  set (gca, 'xminorgrid', 'on')
%!  set (gca, 'yminorgrid', 'on')

%!demo
%!...


Rollback your changeset, add the demos to grid.m and update you commit comments with something like:


Draw minor grid lines at major ticks if major grid is off (bug #48528)

* gl-render.cc (draw_axes_[xyz]_grid): Draw minor grid lines at major
ticks if major grid is off.

* grid.m: Add four demos, some with assert() to highlight other bugs.


Thanks.

Dan Sebald <sebald>
Sat 16 Jul 2016 06:37:56 AM UTC, comment #5: 

I think "grid" doesn't do the right thing as it also changes the other grid which can lead to inconsistent results. In the following example, the minor grid should not be changed at all. The results should not change after calling "grid on" the second time:

gcf;
semilogy (1:100);
grid on
assert (get (gca, "yminorgrid"), "off")
grid on
assert (get (gca, "xminorgrid"), "off")
assert (get (gca, "ygrid"), "on")


But that is imho another bug on which I want to work soon. This is why I refrain from using "grid" in the examples for now:

gcf;
subplot (1,2,1)
plot (1:10);
set (gca, 'xminorgrid', 'on')
set (gca, 'yminorgrid', 'on')
subplot (1,2,2)
semilogy (1:100);
set (gca, 'xminorgrid', 'on')
set (gca, 'yminorgrid', 'on')


Should display minor grid lines also on major ticks.


gcf;
plot (.9:1:198);
axis tight
set (gca, 'xminorgrid', 'on')
set (gca, 'xgrid', 'on')
set (gca, 'yminorgrid', 'on')


Should display minor grid lines also on major ticks in y. Major grid in x should display as expected. Hits bug #45710. A patch is posted there.


gcf;
plot (1:10);
set (gca, 'xtick', [0, 1, pi, 7.3, 10])
set (gca, 'xminorgrid', 'on')
set (gca, 'yminorgrid', 'on')


Should display minor grid lines also on major ticks. The minor grid should adapt to the xticks. Hits bug #45850. A patch is posted there.

Please, let me know if you need more examples.

Markus Mützel <mmuetzel>
Group administrator
Sat 16 Jul 2016 05:23:55 AM UTC, comment #4: 

OK, it sounds maybe more complicated then.  Perhaps one or two more demo examples with no major grid, and with custom major grid lines and minor grid on/off would be valuable.  Type "demo grid" at the command line.

Dan Sebald <sebald>
Sat 16 Jul 2016 05:06:15 AM UTC, comment #3: 

Thank you, Dan, for reviewing this.
The disappearing minor grid you observe might be due to bug #45850. I posted a changeset there as well. At least, the minor grid doesn't disappear for me. But I also have a bunch of other changes in my test build.

Markus Mützel <mmuetzel>
Group administrator
Fri 15 Jul 2016 09:05:47 PM UTC, comment #2: 

I had noticed this about a week ago but thought maybe that was the way it is supposed to be, but I agree it doesn't seem correct.

I like what you've done, as far as not placing both a major grid line and minor grid line one on top of the other.

I did wonder if there is a scenario in which the minor grid and major grid don't aline, but it doesn't appear that the minor grid is individually controllable.  Also, for custom xgrid:


peaks
set(gca,'xminorgrid', 'on')
set(gca,'xgrid', 'off')
[looks ok]
set(gca,'xtick', [-3 -2 0 2 3])
[ah, minor grid looks disabled]


So I think it should be fine.

Dan Sebald <sebald>
Fri 15 Jul 2016 06:35:54 PM UTC, comment #1: 

Attached the changeset which should be applied on top of file #37872 in bug #48429.

Steps to test:

gcf;
plot (1:10);
set (gca, 'xminorgrid', 'on')
set (gca, 'yminorgrid', 'on')
set (gca, 'zminorgrid', 'on')
view (3)


(file #37903)

Markus Mützel <mmuetzel>
Group administrator
Fri 15 Jul 2016 06:26:45 PM UTC, original submission:  

When "xgrid" is "off", but "xminorgid" is "on", minor grid lines are also drawn at "xtick" values in Matlab. The same for y and z.

In Octave, no grid lines are drawn at the major tick values with these settings.

I am going to attach a changeset as soon as I have a bug number.

Markus Mützel <mmuetzel>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #37903:  opengl_grid_minor.patch added by mmuetzel (2KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by andy1978 (Posted a comment)
  • -email is unavailable- added by sebald (Posted a comment)
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-08-22 rik5 Open/ClosedOpen Closed
    2016-08-22 rik5 StatusReady For Test Fixed
    2016-08-20 andy1978 StatusNone Ready For Test
    2016-07-16 mmuetzel Attached File- Added opengl_grid_minor_v2.patch, #37914
    2016-07-15 mmuetzel Attached File- Added opengl_grid_minor.patch, #37903

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code