Skip to content

Commit

Permalink
Merge pull request #2 from MATLAB-Graphics-and-App-Building/Readme_Im…
Browse files Browse the repository at this point in the history
…ages

Fix legend bug and update examples
  • Loading branch information
abbysko authored Nov 15, 2024
2 parents 89cf4e6 + f1d5c36 commit 5c0891f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

Examples.asv
Binary file modified Examples.mlx
Binary file not shown.
11 changes: 9 additions & 2 deletions deltaplot.m
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,15 @@ function setup(obj)
% Create the axes
ax = getAxes(obj);
box(ax,'on');

% Turn legend on and place it outside to the right
obj.LegendVisible = 'on';
ax.Legend.Layout.Tile = 'east';

% Create patch and indicate it should not appear in legend
obj.PatchHandle = patch(ax, 'XData',NaN,'YData',NaN, 'FaceVertexCData',NaN,...
'EdgeColor','interp','MarkerFaceColor','flat');
obj.PatchHandle.Annotation.LegendInformation.IconDisplayStyle='off';

% trigger colororder setter to compute colormap
colors = get(groot,'DefaultAxesColorOrder');
Expand All @@ -310,8 +317,8 @@ function setup(obj)
hold(ax,'on')
obj.Stem1 = stem(ax,NaN, NaN, "filled");
obj.Stem2 = stem(ax,NaN, NaN, "filled");
l=legend(ax,[obj.Stem1 obj.Stem2]);
l.Layout.Tile = 'east';

ax.Legend.Layout.Tile = 'east';

% Call the load method in case of loading from a fig file
loadstate(obj);
Expand Down

0 comments on commit 5c0891f

Please sign in to comment.