Customize tick values in boxplot

조회 수: 106 (최근 30일)
Lukas Netzer
Lukas Netzer 2021년 5월 5일
댓글: Adam Danz 2021년 5월 6일
Hey,
I have the following boxplot:
Instead of 1, 2, 3 on the x-axis I want to have 50kW, 150kW, 300kW - I tried changing tick-values to either only 50, 150, 300 or with kW. Both wont work, as obviously these are not regular tick values. Is there a way to customize it, to have it display what I need?

채택된 답변

Adam Danz
Adam Danz 2021년 5월 5일
편집: Adam Danz 2021년 5월 5일
Use the Labels input option.
boxplot(rand(20,3),'Labels',compose('%dkW',[50,150,300]))
> I tried changing tick-values
You would need to change the xticklabel property.
set(gca, 'xtick',1:3,'XTickLabels',compose('%dkW',[50,150,300]))
  댓글 수: 3
Lukas Netzer
Lukas Netzer 2021년 5월 6일
One more question If I may - how can I have letters in my compose?
like that:
compose('C1;',[abc, def,ghj])
to get those labels:
C1abc C1def C1ghj
Adam Danz
Adam Danz 2021년 5월 6일

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by