2%> Return a blue-red colormap matrix
3%> of shape ``(nell, 3)`` containing a **
redblue** colormap.<br>
6%> The colors begin with bright blue, range through shades of
7%> blue to white, and then through shades of red to bright red.<br>
8%> The output is the same length as the current figure colormap.<br>
9%> If no figure exists, MATLAB will create one.<br>
11%> \param[in] nell : The input scalar MATLAB integer representing
12%> the number of elements (rows) of the output colormap matrix.<br>
13%> (**optional**,
default = ``size(get(gcf,
'colormap'), 1)``)
16%> ``cmap`` : The output blue-red colormap matrix
17%> of shape ``[nell, 3]`` containing a **
redblue** colormap.<br>
22%> cmap = pm.vis.cmap.redblue()
23%> cmap = pm.vis.cmap.redblue([])
24%> cmap = pm.vis.cmap.redblue(nell)
29%> \include{lineno} example/vis/cmap/
redblue/main.m
35%> MATLAB intrinsic functions ``hsv()``, ``gray()``, ``hot()``, ``bone()``, ``copper()``, ``pink()``, ``flag()``, ``colormap()``, ``rgbplot()``.<br>
39%> Adam Auton, 9th October 2009
40%> Copyright (c) 2009, Adam Auton
41%> All rights reserved.
43%> Redistribution and use in source and binary forms, with or without
44%> modification, are permitted provided that the following conditions are
47%> * Redistributions of source code must retain the above copyright
48%> notice,
this list of conditions and the following disclaimer.
49%> * Redistributions in binary form must reproduce the above copyright
50%> notice,
this list of conditions and the following disclaimer in
51%> the documentation and/or other materials provided with the distribution
53%> This software is provided by the copyright holders and contributors
"as is"
54%> and any express or implied warranties, including, but not limited to, the
55%> implied warranties of merchantability and fitness
for a particular purpose
56%> are disclaimed. in no
event shall the copyright owner or contributors be
57%> liable
for any direct, indirect, incidental, special, exemplary, or
58%> consequential damages (including, but not limited to, procurement of
59%> substitute goods or services; loss of use, data, or profits; or business
60%> interruption) however caused and on any theory of liability, whether in
61%> contract, strict liability, or tort (including negligence or otherwise)
62%> arising in any way out of the use of
this software, even
if advised of the
63%> possibility of such damage.
66%> \JoshuaOsborne, May 21 2024, 7:44 AM, University of Texas at Arlington<br>
67%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
68%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
71 nell = size(get(gcf,
'colormap'), 1);
73 if (mod(nell, 2) == 0)
74 % From [0 0 1] to [1 1 1], then [1 1 1] to [1 0 0];
75 nellHalf = nell * 0.5;
76 r = (0 : nellHalf - 1)
' / max(nellHalf - 1, 1);
78 r = [r; ones(nellHalf, 1)];
82 % From [0 0 1] to [1 1 1] to [1 0 0];
83 nellHalf = floor(nell * 0.5);
84 r = (0 : nellHalf - 1)' / max(nellHalf, 1);
86 r = [r; ones(nellHalf + 1, 1)];
87 g = [g; 1; flipud(g)];
function list()
Return a list of MATLAB strings containing the names of OS platforms supported by the ParaMonte MATLA...
function redblue(in nell)
Return a blue-red colormap matrix of shape (nell, 3) containing a redblue colormap.