フィルターのクリア

How to make axis line invisible but keep xlabel and ylabel?

32 ビュー (過去 30 日間)
Mr M.
Mr M. 2018 年 7 月 23 日
コメント済み: Adam Danz 2021 年 4 月 19 日
I tried axis off, or set(gca,'xcolor','w'), but the problem is I want to keep the xlabel, morover white color is not good for me, because I am using imagesc and white ticks are visible on the colored figure.

採用された回答

jonas
jonas 2018 年 7 月 23 日
編集済み: jonas 2018 年 7 月 23 日
h=get(gca);
set(h,'xcolor','none')
h.XAxis.Label.Color=[0 0 0];
h.XAxis.Label.Visible='on';
  6 件のコメント
Walter Roberson
Walter Roberson 2021 年 3 月 12 日
imagesc(rand(32,40))
xlabel('x')
ylabel('y')
zlabel('z')
h = gca; %fixed relative to jonas's suggestion
set(h,'xcolor','none')
h.XAxis.Label.Color=[0 0 0]; h.XAxis.Label.Visible='on';
The y label ticks are visible; the x label ticks are not; the x label itself is visible.
However, I have not tried this in R2019b.
Adam Danz
Adam Danz 2021 年 4 月 19 日
Another approach:
ax.XRuler.Axle.Visible = 'off'; % ax is axis handle
ax.YRuler.Axle.Visible = 'off';
Credit: Yair's UndocumentedMatlab

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by