Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • ab20b0c
  • /
  • util
  • /
  • figures
  • /
  • makeCmap.m
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:8c0ccdb1f67458082855c180df7fd2ad86d40ee0
directory badge Iframe embedding
swh:1:dir:b060a8bc431ff235846ee186756b33ebf355f5a7
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
makeCmap.m
function customCMap = makeCmap(data, middle,topColor, indexColor, bottomColor)
        %https://www.mathworks.com/matlabcentral/answers/305073-colormap-fixed-middle-value
        L = numel(data);
        
        % Calculate where proportionally indexValue lies between minimum and
        % maximum values
        largest = max(max(data));
        smallest = min(min(data));
        index = L*abs(middle-smallest)/(largest-smallest);
        % Create color map ranging from bottom color to index color
        % Multipling number of points by 100 adds more resolution
        customCMap1 = [linspace(bottomColor(1),indexColor(1),100*index)',...
                    linspace(bottomColor(2),indexColor(2),100*index)',...
                    linspace(bottomColor(3),indexColor(3),100*index)'];
        % Create color map ranging from index color to top color
        % Multipling number of points by 100 adds more resolution
        customCMap2 = [linspace(indexColor(1),topColor(1),100*(L-index))',...
                    linspace(indexColor(2),topColor(2),100*(L-index))',...
                    linspace(indexColor(3),topColor(3),100*(L-index))'];
        customCMap = [customCMap1;customCMap2];  % Combine colormaps
end

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API