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

4 vues (au cours des 30 derniers jours)
Xiaohan Du
Xiaohan Du le 12 Oct 2017
Commenté : Xiaohan Du le 12 Oct 2017
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!

Réponse acceptée

KSSV
KSSV le 12 Oct 2017
axis off
  3 commentaires
KSSV
KSSV le 12 Oct 2017
a = rand(5, 2);
spy(a)
set(gca,'xticklabel',{[]})
set(gca,'yticklabel',{[]})
delete(findall(findall(gcf,'Type','axe'),'Type','text'))
Xiaohan Du
Xiaohan Du le 12 Oct 2017
thanks! this is what I'm looking for!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Sparse Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by