필터 지우기
필터 지우기

how can make 3bar plot xylabel for string?

조회 수: 1 (최근 30일)
영훈 정
영훈 정 2023년 4월 4일
답변: Cris LaPierre 2023년 4월 4일
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'

채택된 답변

Cris LaPierre
Cris LaPierre 2023년 4월 4일
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'})

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by