Skip to content
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

Correct setting of MarkerFaceColor / MarkerEdgeColor #1083

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/matlab2tikz.m
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,14 @@ case guitypes()
end
end
case 'MATLAB'
legendhandle = legend(axisHandle);
if isprop(axisHandle, 'Legend') % R2017b behavior
legendhandle = axisHandle.Legend;
else
legendhandle = legend(axisHandle);
% this is the proper way for old versions of MATLAB
% in newer versions (see #1006), calling `legend` may
% create a legend in the figure where none existed before
end
end

% NOTE: there is a BUG in HG1 and Octave. Setting the box off sets the
Expand Down Expand Up @@ -2018,14 +2025,14 @@ function assertRegularAxes(handle)
[m2t, markerInfo.options] = setColor(m2t, h, markerInfo.options, 'fill', markerInfo.FaceColor);

if ~strcmpi(markerInfo.EdgeColor,'auto')
[m2t, markerInfo.options] = setColor(m2t, h, markerInfo.options, '', markerInfo.EdgeColor);
[m2t, markerInfo.options] = setColor(m2t, h, markerInfo.options, 'draw', markerInfo.EdgeColor);
else
if isprop(h,'EdgeColor')
color = get(h, 'EdgeColor');
else
color = get(h, 'Color');
end
[m2t, markerInfo.options] = setColor(m2t, h, markerInfo.options, '', color);
[m2t, markerInfo.options] = setColor(m2t, h, markerInfo.options, 'draw', color);
end

% add it all to drawOptions
Expand Down