plotly / plotly/plotly_matlab

Problems with the legend when plotting multiple charts on same figure

Offen
#195 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@gilbertogalvis arbeitet bereits daran.

Seit 18.8.2021.

Vorherrschende Sprache
MATLAB
Sterne
413
Forks
166
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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:

Captura de Pantalla 2021-07-26 a la(s) 4 34 21 p  m Captura de Pantalla 2021-07-26 a la(s) 4 34 46 p  m

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.