Skip to content

Commit

Permalink
Inversion of labels bug in gplotmatrix fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
DomenicoPerrottaJRC committed Oct 13, 2024
1 parent 348571b commit 8c3d789
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions toolbox/utilities/clickableMultiLegend.m
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,12 @@ function togglevisibility(plotHandle)
if isa(axesObjects(i).Children, 'matlab.graphics.chart.primitive.Line')
% disp(['Panel ', num2str(i), ' contains a line plot'])
% Assign the same DisplayName property to each group in each panel
for g = 1:nlegendEntries
axesObjects(i).Children(g).DisplayName = legendEntries{g};
if i==1, indice = zeros(nlegendEntries,1); end
for g = 1:nlegendEntries
if i==1
[~, indice(g)] = ismember({axesObjects(i).Children(g).DisplayName}, legendEntries);
end
axesObjects(i).Children(g).DisplayName = legendEntries{indice(g)};
end
else
% disp(['Panel ', num2str(i), ' does not contain a line plot'])
Expand Down

0 comments on commit 8c3d789

Please sign in to comment.