legendbar
Keine Lizenz
LEGENDBAR places your items in legend in just same way as they stacked in bar, from the first item at lowest place up to last item at highest place.
Don't forget to write the corresponding strings in opposite order as well!
Example: the same as in "help legend"
but here legend looks much nicer:
x = 0:.2:12;
plot(x,bessel(1,x),x,bessel(2,x),x,bessel(3,x));
legend('First','Second','Third');
legend('First','Second','Third',-1)
b = bar(rand(10,5),'stacked'); colormap(summer); hold on
x = plot(1:10,5*rand(10,1),'marker','square','markersize',12,...
'markeredgecolor','y','markerfacecolor',[.6 0 .6],...
'linestyle','-','color','r','linewidth',2); hold off
legend([legendbar(b),x],'Cucumbers','Green Beans','Peppers',...
'Peas','Carrots','Eggplant')
Zitieren als
Isabella Osetinsky-Tzidaki (2024). legendbar (https://www.mathworks.com/matlabcentral/fileexchange/6938-legendbar), MATLAB Central File Exchange. Abgerufen .
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
1.0.0.0 | More shorter |