cspy.m

버전 1.6.0.0 (5.82 KB) 작성자: Hugo Gualdron
cspy: a color-coded version of sparse matrix viewer spy
다운로드 수: 1.1K
업데이트 날짜: 2014/6/6

라이선스 보기

편집자 메모: This file was selected as MATLAB Central Pick of the Week

cspy Visualize sparsity pattern.
cspy(S) plots the sparsity pattern of the matrix S with L levels where
L by default is number of integers between min matrix value and max
matrix value .

cspy(S,'Marker', '*') use the this marker to plot the matrix S.

cspy(S, 'Marker', {'*', '+'}) use each marker per level in the same
order. The size of the marker cell array must be equal to the number of
levels, in otherwise is used the first marker for all levels.

cspy(S,'MarkerSize', M) use the M markersize to plot the matrix S.

cspy(S, 'Levels', L) use L levels to show different colors in the
matrix S. If the levels is a vector and has the same size to channels
is used one value for channel. Where level hasn't the same size is used
the mean value.

cspy(S, 'ColorMap', 'hot') use this model color to assign the colors.
By default the colormap is 'lines'.

cspy(S, 'XDir', 'Reverse') change the X direction (Reverse or Normal).
Default Normal

cspy(S, 'YDir', 'Reverse') change the Y direction (Reverse or Normal).
Default Reverse

cspy(S, 'Channels', 'on') use the channel value ('on' or 'off' ) for
plot the images channels in different subplots (rgb for example) or
where the matrix is n x m x c where c are the channels. if the channels
value is 'off' and the matrix has c channels with c different to 3(rgb)
the channels value is changed to 'on'.

Examples:
---------------------------------------------------------
cspy(bucky);
---------------------------------------------------------
rgb = imread('ngc6543a.jpg');
cspy(rgb, 'marker', '.', 'markersize', 5, 'colormap', 'hot');
---------------------------------------------------------
rgb = imread('ngc6543a.jpg');
cspy(rgb, 'marker', '.', 'markersize',5, 'colormap', 'hot', 'levels', 18);
---------------------------------------------------------
rgb = imread('ngc6543a.jpg');
cspy(rgb, 'marker', '.', 'markersize',5, 'colormap', 'hot', 'levels', 18, 'channels', 'on');
---------------------------------------------------------
rgb = imread('ngc6543a.jpg');
cspy(rgb, 'marker', '.', 'markersize',5, 'colormap', 'lines', 'levels', [2 15 3], 'channels', 'on');
---------------------------------------------------------
rgb = imread('ngc6543a.jpg');
cspy(rgb, 'marker', {'.', '+', '*'}, 'markersize',5, 'colormap', 'lines', 'levels', 3, 'channels', 'off');

Authors:
Hugo Gualdron - gualdron@usp.br
Jose Rodrigues - junio@icmc.usp.br
University of São Paulo

인용 양식

Hugo Gualdron (2024). cspy.m (https://www.mathworks.com/matlabcentral/fileexchange/46551-cspy-m), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Discrete Data Plots에 대해 자세히 알아보기
도움

줌: spy3D

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.6.0.0

Support for different marker type per level

1.5.0.0

Mistake where the matrix is not square solved.

1.4.0.0

Summary and description updated

1.3.0.0

- Mistakes with axes and the function flipud (Changed by YOrder=Reverse)
- Added XDir and YDir

1.2.0.0

Channels support

1.1.0.0

Error fixed: where the matrix levels is lower or equal to 1.

1.0.0.0