Hey I have plotted a graph but I want to remove the values on the axis, I don't want the numbers to show

 採用された回答

Chenchal
Chenchal 2017 年 11 月 3 日

15 投票

% code
x = rand(1,100);
plot(x);
set(gca,'XTick',[], 'YTick', [])

3 件のコメント

ed ro
ed ro 2020 年 4 月 15 日
but I dont want to erase the grid as well... how to just hide the values??
Kyril Kaufmann
Kyril Kaufmann 2020 年 6 月 6 日
% gca = ax
set(ax,'xticklabel',[])
Paulo Providencia
Paulo Providencia 2023 年 3 月 10 日
I had to use xticklabels([])

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

その他の回答 (1 件)

DanielFromIllinois
DanielFromIllinois 2025 年 3 月 11 日

0 投票

set(ax,'xticklabel',[])
You can also use set(ax,'XTick',[]) but then you lose the ability to still turn the xgrid on. The grid will draw lines at your ticks specified by 'XTick'.

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by