About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconMKPJ - perceptually improved Jet colormap (Scripts) Publisher's description

function map=mkpj(n,scheme)

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 it’s 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
% colormaps".
% 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
% http://mycarta.wordpress.com/
% arguments: (input)
% scheme - can be one of the following strings:
% 'JetI'
% The new, more perceptually balanced, Jet color map.
% This explanation should be read in conjunction with the submitted figure
% "JET_idea_after_scaling_final_L_plt.png"
% 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.
% 'J'
% 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;


System Requirements:

MATLAB 7.10 (2010a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

MKPJ - perceptually improved Jet colormap (Scripts) Tags:

Click on a tag to find related softwares

Is MKPJ - perceptually improved Jet colormap (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.