Problems with the legend when plotting multiple charts on same figure
Open
@gilbertogalvis is already working on this.
Since Aug 18, 2021.
- Dominant language
- MATLAB
- Stars
- 413
- Forks
- 166
- PR merge metrics
- No merged PRs in 30d
Description
When placing a legend on a figure with multiple charts, only one of them is correctly labeled.
For example,
y2010 = [50 0 100 95];
y2011 = [65 22 97 120];
labels = {'Investments','Cash','Operations','Sales'};
t = tiledlayout(1,2,'TileSpacing','compact');
% Create pie charts
ax1 = nexttile;
pie(ax1,y2010)
title('2010')
ax2 = nexttile;
pie(ax2,y2011)
title('2011')
% Create legend
lgd = legend(labels);
lgd.Layout.Tile = 'east';
fig2plotly();
Expected and generated () plots:
As you can see, the two legends are pretty different.
The previous example can be found on:
https://www.mathworks.com/help/matlab/ref/pie.html#responsive_offcanvas
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.