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

조회 수: 5 (최근 30일)
Xiaohan Du
Xiaohan Du 2017년 10월 12일
댓글: Xiaohan Du 2017년 10월 12일
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일
axis off
  댓글 수: 3
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개)

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by