Wed 31 Aug 2016 04:52:47 AM UTC, comment #9:
I pushed your final cset for grid.m here (http://hg.savannah.gnu.org/hgweb/octave/rev/22f22d53f135). Closing report (again!).
|
Tue 30 Aug 2016 05:12:10 PM UTC, comment #8:
Rik, that was exactly what needed to be changed.
The attached changeset also turns the minor grid off for semilog plots when "grid" is called the second time and adds the same set of tests for semilogy that was already added for plot.
Additionally, I added a demo for the changes in bug #48528. That should probably better go into graphic.cc but - as I understand - demos in .cc-files cannot be run, and "grid.m" probably fits best.
(file #38390)
|
Tue 30 Aug 2016 03:51:44 PM UTC, comment #7:
Yes, it seems that the the status of the axis (linear vs. log) should be checked first before turning on the minor grid.
|
Tue 30 Aug 2016 03:30:13 PM UTC, comment #6:
Recent changes to grid improved it significantly. It is even more Matlab compatible than what I proposed in comment #0. Nevertheless, I don't think this bug is solved completely. Calling "grid on" twice for semi-log plots still leads to an inconsistent result:
The second call should not turn on the minor grid in x-direction (linear axis).
Also, see Matlab's behavior for a linear plot with minor grid on in one direction (the same holds for semilogx plots):
It seems that this is not (any longer?) necessary to follow Matlab, either. The logic should be removed that turns all minor grids on if only one minor grid is "on" before calling "grid on".
If nobody objects, I can provide a changeset probably within the next few days.
|
Mon 22 Aug 2016 05:05:12 PM UTC, comment #5:
@Andy: I tested your cset and made one small change: 'grid off' now turns off both grids for logarithmic axes. I pushed the cset here (http://hg.savannah.gnu.org/hgweb/octave/rev/c381f78e79bf). Fixed, closing report.
|
Sat 20 Aug 2016 04:25:55 PM UTC, comment #4:
I really like the 'minor-auto' feature for logarithmic plots. Let's be better than Matlab in this regard.
|
Sat 20 Aug 2016 02:28:12 PM UTC, comment #3:
How do we want to proceed with the "minor-auto" feature for logarithmic axes which, as far as I understand, is Octave specific.
Automatically enabling minorgrid on log axes with "grid on" looks like a nice feature to me.
Attached my last patch which decouples major and minor grid but leaves the "minor-auto" feature for lag axes.
(file #38290)
|
Tue 16 Aug 2016 09:22:38 PM UTC, comment #2:
I think at some point we were actually following Matlab behavior. I seem to remember that with no grid, 'grid minor' would turn both the major and minor grid on.
But, if Matlab has changed its behavior then we can too. It sort of makes sense to be able to control the major and minor grids independently.
|
Wed 20 Jul 2016 06:51:21 AM UTC, comment #1:
I think the logic in "grid.m" is some hack to work around bug #48528.
I posted a changeset there that should fix that properly for the opengl toolkits. I will wait for a fix here to see when/if the other bug is acceptable.
|
Sat 16 Jul 2016 05:07:58 PM UTC, original submission:
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:
This also leads to different results when calling "grid on" twice:
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.
|