How to create a two-line y label for bar plot?

23 visualizaciones (últimos 30 días)
Duc Tran
Duc Tran el 30 de En. de 2022
Comentada: Duc Tran el 9 de Feb. de 2022
Hi, I have a code below that I use to plot 4 different categories data with label on the y-axis. I want to make each catogory label into 2 lines so that it looks neater when plot and I was wondering how I can do that.
X = categorical({'Energy Consumption', 'Environmental Impact', 'Manufacturing Cost', 'Value of Products'});
y = [1 5.22; 1 3.76; 1 1.61; 1 0.42];
b = barh(X,y);

Respuesta aceptada

the cyclist
the cyclist el 31 de En. de 2022
There are ideas on how to do this in this answer.

Más respuestas (0)

Categorías

Más información sobre Annotations en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by