GUI graph with strings as axis

조회 수: 15 (최근 30일)
Soham Shah
Soham Shah 2019년 5월 10일
편집: Adam Danz 2019년 5월 10일
how can I make several strings the x-axis for a graph in a GUI
  댓글 수: 2
Adam Danz
Adam Danz 2019년 5월 10일
Do you want to set the x tick labels?
Soham Shah
Soham Shah 2019년 5월 10일
yes how can I do that?

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

채택된 답변

Adam Danz
Adam Danz 2019년 5월 10일
편집: Adam Danz 2019년 5월 10일
Here's a demo
ax = axes(); %Instead of this line, use the axis handle from your GUI handles
xTickVals = [2,4,6]; %<-- where you want the ticks
xlim([1,7]) %<-- make sure the ticks are within range
xTickLables = {'RO', 'BG', 'TR'}; %<-- your tick labels
set(ax, 'XTick', xTickVals, 'XTickLabels', xTickLables) % <-- set the ticks & labels

추가 답변 (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