how can I make several strings the x-axis for a graph in a GUI

2 Comments

Do you want to set the x tick labels?
yes how can I do that?

Sign in to comment.

 Accepted Answer

Adam Danz
Adam Danz on 10 May 2019
Edited: Adam Danz on 10 May 2019
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

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Asked:

on 10 May 2019

Edited:

on 10 May 2019

Community Treasure Hunt

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

Start Hunting!