You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The minor grid style default in pgfplots is solid line, not dotted as the default in MATLAB, so this change would make it
I changed lines 1007-1011 from this:
[minorGridLS, isDefault] = getAndCheckDefault(...
'axes', handle, 'MinorGridLineStyle', ':');
if ~isDefault || m2t.args.strict
minorGridOpts = opts_add(minorGridOpts, translateLineStyle(minorGridLS));
end
To this:
[minorGridLS, ~] = getAndCheckDefault(...
'axes', handle, 'MinorGridLineStyle', ':');
%If statement removed because dotted style is not default in pgfplots
minorGridOpts = opts_add(minorGridOpts, translateLineStyle(minorGridLS));
Also, to actually draw the minor grid lines we need to set minor tick num. Usually MATLAB draws three lines between major ticks. My workaround was to create minor ticks without the minor tick labels by adding this after line 1006:
matlabDefaultNumMinorTicks = 3;
minorGridOpts = opts_add(minorGridOpts, 'minor tick num', num2str(matlabDefaultNumMinorTicks));
minorGridOpts = opts_add(minorGridOpts, 'minor tick style', '{draw=none}');
Of course this will conflict whenever you actually have minor tick labels, specially with the {draw=none} option. Hopefully you guys can come up with something smarter for this problem.
Thanks,
Andre
The text was updated successfully, but these errors were encountered:
The minor grid style default in pgfplots is solid line, not dotted as the default in MATLAB, so this change would make it
I changed lines 1007-1011 from this:
[minorGridLS, isDefault] = getAndCheckDefault(...
'axes', handle, 'MinorGridLineStyle', ':');
if ~isDefault || m2t.args.strict
minorGridOpts = opts_add(minorGridOpts, translateLineStyle(minorGridLS));
end
To this:
[minorGridLS, ~] = getAndCheckDefault(...
'axes', handle, 'MinorGridLineStyle', ':');
%If statement removed because dotted style is not default in pgfplots
minorGridOpts = opts_add(minorGridOpts, translateLineStyle(minorGridLS));
Also, to actually draw the minor grid lines we need to set minor tick num. Usually MATLAB draws three lines between major ticks. My workaround was to create minor ticks without the minor tick labels by adding this after line 1006:
matlabDefaultNumMinorTicks = 3;
minorGridOpts = opts_add(minorGridOpts, 'minor tick num', num2str(matlabDefaultNumMinorTicks));
minorGridOpts = opts_add(minorGridOpts, 'minor tick style', '{draw=none}');
Of course this will conflict whenever you actually have minor tick labels, specially with the {draw=none} option. Hopefully you guys can come up with something smarter for this problem.
Thanks,
Andre
The text was updated successfully, but these errors were encountered: