Borrar filtros
Borrar filtros

how can make 3bar plot xylabel for string?

1 visualización (últimos 30 días)
영훈 정
영훈 정 el 4 de Abr. de 2023
Respondida: Cris LaPierre el 4 de Abr. de 2023
i want to make a string label
z = [1 4 7; 2 5 8; 3 6 9;];
bar3(z)
xlabel=['a' 'b' 'c']
xlabel = 'abc'
ylabel=['A' 'B' 'C']
ylabel = 'ABC'

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 4 de Abr. de 2023
You are creating variables. You need to modify your syntax to use the xlabel and ylabel functions.
Also, labels apply to the whole axes.
z = [1 4 7; 2 5 8; 3 6 9;];
bar3(z)
xlabel(['a' 'b' 'c'])
ylabel(['A' 'B' 'C'])
I think you are actually trying to modify the xticklabels and yticklabels. You also need to change your syntax slightly to do that.
z = [1 4 7; 2 5 8; 3 6 9;];
bar3(z)
xticklabels({'a' 'b' 'c'})
yticklabels({'A' 'B' 'C'})

Más respuestas (0)

Categorías

Más información sobre Call Python from MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by