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

3 visualizaciones (últimos 30 días)
Xiaohan Du
Xiaohan Du el 12 de Oct. de 2017
Comentada: Xiaohan Du el 12 de Oct. de 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!

Respuesta aceptada

KSSV
KSSV el 12 de Oct. de 2017
axis off
  3 comentarios
KSSV
KSSV el 12 de Oct. de 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 el 12 de Oct. de 2017
thanks! this is what I'm looking for!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Discrete Data Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by