MATLAB: How to change the name “nz” in the x axis of the funcion spy

axisplotspy

I want to change only "nz" in the x axis of the spy's plot, not the number which tell me how many elements are nonzero elements. Thank you!

Best Answer

That's just the xlabel of the axes.
>> B = bucky;
>> spy(B);
>> xlabel(sprintf('Number of nonzero elements: %d', nnz(B)))