フィルターのクリア

XtickLabels on plots or scatters

3 ビュー (過去 30 日間)
Tiago Dias
Tiago Dias 2018 年 9 月 10 日
コメント済み: Tiago Dias 2018 年 9 月 10 日
Hello,
I got a cell A = {'A','B','C'} and B = [3, 6, 9]
my objective is to plot the values of X, with Xticklabel of A. I know that bar chart work fine, but I would prefer plot with markers
Thanks for your time
This is what i tried
A = [2,3,4,5,6]
figure
scatter(1:5,A)
set(gca,'XTickLabel',{'a','b','c','d','e'})
  2 件のコメント
jonas
jonas 2018 年 9 月 10 日
Well, what is the problem? It seems to work just fine.
Tiago Dias
Tiago Dias 2018 年 9 月 10 日
'a' is with number 2, but 'b' should be 3, and has no value associated. Beside that, when Xlabel achieve 'e', it continues to 'a' again and should stop on 'e'

サインインしてコメントする。

採用された回答

jonas
jonas 2018 年 9 月 10 日
Something like this?
x = 1:5
A = [2,3,4,5,6]
figure
scatter(x,A)
set(gca,'xtick',x,'XTickLabel',{'a','b','c','d','e'})
  1 件のコメント
Tiago Dias
Tiago Dias 2018 年 9 月 10 日
perfect, thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxes Appearance についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by