MKPJ - perceptually improved Jet colormap 1.0
File ID: 83406
MKPJ - perceptually improved Jet colormap 1.0
File Size: 2.8 MB
MKPJ - perceptually improved Jet colormap 1.0 Description
Description: function map=mkpj(n,scheme)
% MKPJ Returns a perceptually improved Jet colormap
% MKPJ (N,SCHEME) returns an Nx3 colormap.
% usage: map=mkpj(n,scheme);
% JUSTIFICATION: rainbow, or spectrum color schemes are considered a poor
% choice for scientific data display by many in the scientific community
% (see for example reference 1 and 3) in that they introduce artifacts
% that mislead the viewer. "The rainbow color map appears as if itd-deOaos separated
% into bands of almost constant hue, with sharp transitions between hues.
% Viewers perceive these sharp transitions as sharp transitions in the data,
% even when this is not the casein how regularly spaced (interval) data are
% displayed (quoted from reference 1). The default Matlab Jet is no exception.
% Please see examples in my previous FEX submission "Perceptually improved
% This submission is intended to share the results of my work to create a
% more perceptually balanced, Jet colormap. Please see output arguments section
% for more details.
% A full series of posts on improved colormaps will appear on my blog at
% arguments: (input)
% scheme - can be one of the following strings:
% The new, more perceptually balanced, Jet color map.
% This explanation should be read in conjunction with the submitted figure
% The idea to improve the default jet came to me after seeing the human
% wavelenght discrimination curve from Gregory (1964) in the paper by
% Welland et al. (2006).
% The top display in the figure is the standard Matlab Jet. Below it,
% second display, is the Luminance versus wavelenght profile. This is
% essentially the same as plot you would find in the left plot of
% figure 3 in Rogowitz and Kalvin (2001). In the third display I reproduced
% Gregory's curve. It's considering these two together that brought the
% Eureka moment (though it took me a few experiments and some calculations
% to line them up properly). The idea was: "can I use this curve to
% dynamically stretch the rainbow where transitions are too sharp
% (basically around the cyan and yellow), compared to everywhere else?".
% The answer is yes, it can be done. In practice this amounted to calculate
% the "inverted" function in the fourth display. Assuming a distance of 1
% between each of the 256 samples on the x axis in the original Jet colormap,
% the function was used to resample it at non-integer distances (up
% to 1.5 where the yellow is, unmodified at 1 where the cyan is, less
% than 1 everywhere else) resulting in a greater number of samples in
% the yellow area in the display compared to all the blue areas, with
% the total number of samples staying at 256. The next step was to force
% all these new samples back to a distance of 1, achieving a
% continuously dynamic stretch. The resulting colormap is shown in
% the fifth display and accompanied by its Luminance versus wavelenght
% in the last display. This profile is noticeably more perceptually
% balnced with gentler transitions and a compressive character.
% To me this is a very good result, even though it's not perfect.
% In an ideal world I would have paired one of the several human wavelenght
% discrimination curves found in Wyszecki and Stiles (2000)
% with in conjunction with the corresponding spectrum color functions
% (many are referenced in the FEX submission "Spectral and XYZ Color
% Functions"), but the problem I had was to identify a matching pair;
% a problem that in the end proved insurmountable.
% This is the original default Jet which I clipped to lign up with Gregory's curve.
% n - scalar specifying number of points in the colorbar. Maximum n=256
% If n is not specified, the size of the colormap is determined by the
% current figure. If no figure exists, MATLAB creates one.
% arguments: (output)
% map - the output colormap i
% Example: compare cape topography using the improved Jet vs. default Jet(clipped)
% % load cape;
% % imagesc(X); colormap(mkpj(128,'JetI')); colorbar;
% % figure;
% % imagesc(X); colormap(mkpj(128,'J')); colorbar;
See also: JET, HSV, GRAY, HOT, COOL, BONE, COPPER, PINK, FLAG, PRISM,
Related: resulting, unmodified, greater, Number, areas, Distances, noninteger, Distance, Samples, original
O/S:BSD, Linux, Solaris, Mac OS X
File Size: 2.8 MB
|More Similar Code|
PMKMP Returns perceptually balanced colormaps with rainbow-like colors
PMKMP(N,SCHEME) returns an Nx3 colormap.
JUSTIFICATION: rainbow, or spectrum color schemes are considered a poor choice for scientific data display by many in the scientific community (see for example reference 1 and 2) in that they introduce artifacts that mislead the viewer. "The rainbow color map appears as if...
CMAPLINE finds all lines in an axis and specifies their colors according to a colormap. Also accepts custom colormaps in the form of a n x 3 matrix.
EXAMPLE (generates screenshot)
%generate some data
Instead of starting with dark blue like Jet, this colormap starts with white. It goes to pure blue from white, and then continues exactly as Jet does, ranging through shades blue, cyan, green, yellow, and red, and ending with dark red.
function [c_img] = RGB_layers(imgs,RGBs)
RGB_layers - Visualize n gray/binary images in pseudo color
imgs: m*k*n matrix. imgs(:,:,i) is a grayscale/BW image.
RGBs: n*3 matrix, each row...
This function plots a 3D line (x,y,z) encoded with scalar color data (c) using the specified colormap (default=jet). Thus, lines with variable color can be plotted (eg. temperature along a 3D line path).
The JET Code Generator is a DataBase code generation system based on industry standard XSLT. If you've ever felt that you're writing the same data access code over and over again, this tool is for you!!
The process represented by the...
A colormap with colors orange-white-light blue. The length of the colormap can be defined with additional parameters (e.g. colormap(esa(256)).
Vim Color Improved is a syntax highlighting plugin that allows you to include code from local or reomte files in your WordPress posts.
It uses the same tag and parameter parsing as the popular CodeViewer 1.4, and should be compatible...
JET Net is a collection of packages of the Java API for communication over standard internet protocols. This application supports HTTP with full support for all HTTP headers and a cookie API. Also it provides access to internet news servers with...
JET Proxy can serve data from any other JDBC functioning as a JDBC proxy driver and uses RMI to implement it. JET Proxy is a type 3 JDBC driver. You can employ it to access ODBC data sources like MS Access that is supported only by Windows from...
|User Review for MKPJ - perceptually improved Jet colormap