sanePColor(varargin​)

버전 1.2.0.0 (5.03 KB) 작성자: Jeremy Manning
Wrapper for pcolor that behaves similarly to imagesc. Squash OS X Preview's "blurry image" bug!
다운로드 수: 1.9K
업데이트 날짜: 2016/10/6

라이선스 보기

sanePColor simple wrapper for pcolor

Unlike the built-in pcolor command, this function does not "cut off" the
last row and column of the input matrix. In this way, sanePColor is
intended to be as easy to use as imagesc, but allows the user to specify
the x and y coordinates of each cell if desired. This function is also
useful as an alternative means of generating images to print to PDF that
are compatible with OS X's "Preview" PDF viewer (imagesc images appear
"blurred" when printing to a PDF as a vector graphic and viewed using
Preview).

NOTE: The imagesc function assumes that each entry in a matrix gets the
corresponding coordinate in 2-d space. For example, entry (2,3) in the
matrix is assigned to the coordinate with x = 3, y = 2 when using
imagesc. The pcolor function assumes that entries correspond to *edges*.
So entry (2,3) in a matrix corresponds to the value between 2 and 3
(along the x-axis) and between 1 and 2 (along the y-axis). This is why
one row and one column are cut off when using pcolor. sanePColor
behaves like imagesc (i.e. does not cut off data), but uses the "edge
assignment" data representation required by pcolor. sanePColor uses
linear or logarithmic interpolation to infer the edges automatically.

Usage: p = sanePColor([x,y],z,[logx],[logy]);

INPUTS:

x: an array of sorted x values. can also specify a min and max x value.
these values correspond to columns of z. [IF THIS ARGUMENT IS USED,
MUST ALSO SPECIFY Y VALUES.]

y: an array of sorted y values. can also specify a min and max y value.
these values correspond to rows of z. [IF THIS ARGUMENT IS USED,
MUST ALSO SPECIFY X VALUES.]

z: a 2d matrix of values. this matrix determines the color at each
point.

logx: if this optional argument is set to true, the x-axis will plotted
in log scale (similar to semilogx).

logy: if this optional argument is set to true, the y-axis will plotted
in log scale (similar to semilogy).

OUTPUTS:

p: a handle to the resulting pcolor image.

EXAMPLE:

m = membrane;
p = sanePColor(m);

SEE ALSO: pcolor, image, imagesc, semilogx, semilogy, loglog, padarray

AUTHOR: JEREMY R. MANNING
CONTACT: manning3@princeton.edu

인용 양식

Jeremy Manning (2024). sanePColor(varargin) (https://www.mathworks.com/matlabcentral/fileexchange/35601-sanepcolor-varargin), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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

Added support for irregular axis spacing

1.1.0.0

corrected handling of axes (data cursor now shows correct values). tick marks are now handled through pcolor.

1.0.0.0