-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minor grid style #1134
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: