any way to add legend in bar plot like this?

2 visualizaciones (últimos 30 días)
Yu Li
Yu Li el 4 de Jun. de 2019
Editada: KALYAN ACHARJYA el 4 de Jun. de 2019
Hi:
is there anyway to add legend of a bar plot like below? i.e. put the bar plot on the left side and the legend on the right side, in one figure.
Thanks!
Yu

Respuestas (1)

KALYAN ACHARJYA
KALYAN ACHARJYA el 4 de Jun. de 2019
Editada: KALYAN ACHARJYA el 4 de Jun. de 2019
See this example
y=[2 2 3; 2 5 6; 2 8 9; 2 11 12];
bar(y,'stacked');
legend('level1','level2','level3','Location','Best','FontSize',8);
yy.png
  2 comentarios
Yu Li
Yu Li el 4 de Jun. de 2019
I'm sorry, I did not clearly deomnstrate my question, I would like to know how to move the bar plot to the left side, and add the legend in right side.
Thanks!
Yu
KALYAN ACHARJYA
KALYAN ACHARJYA el 4 de Jun. de 2019
Editada: KALYAN ACHARJYA el 4 de Jun. de 2019
You can drag (cursor move) and place in figure window. My Matlab v 2018b

Iniciar sesión para comentar.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by