How to remove axis from a sparsity plot with spy function?

Hello,
I plot the sparsity of a matrix with spy, like this:
a = rand(5, 2);
spy(a)
So it comes with x and y axis, and
nz = 10
on the bottom, which is completely normal. Does anyone know how to remove these axis and 'nz = 10'?
Thanks!

 採用された回答

KSSV
KSSV 2017 年 10 月 12 日

0 投票

axis off

3 件のコメント

Xiaohan Du
Xiaohan Du 2017 年 10 月 12 日
frame also gone? Can we keep the box frame?
KSSV
KSSV 2017 年 10 月 12 日
a = rand(5, 2);
spy(a)
set(gca,'xticklabel',{[]})
set(gca,'yticklabel',{[]})
delete(findall(findall(gcf,'Type','axe'),'Type','text'))
Xiaohan Du
Xiaohan Du 2017 年 10 月 12 日
thanks! this is what I'm looking for!

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

その他の回答 (0 件)

カテゴリ

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

タグ

質問済み:

2017 年 10 月 12 日

コメント済み:

2017 年 10 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by