Mathematica中文论坛-非官方

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 35817|回复: 0
打印 上一主题 下一主题

豆粑粑 matlab colormap cold

[复制链接]

550

主题

629

帖子

3181

积分

论坛元老

Rank: 8Rank: 8

积分
3181
跳转到指定楼层
楼主
发表于 2017-12-25 10:33:37 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
Normally,  i perfer the "hot" colormap to illustrate the "heavy" -> "light" color.But with diff propeties of  the total opposite value, Such as ,the pops and popc denisty.
I need a color map as the opposite of "hot". Ha, I use the name "cold".
Great minds think alike.
I got the "cold " colormap on File Exchange.
https://cn.mathworks.com/matlabc ... 23865-cold-colormap

The same thought as I got.



  1. function cmap = cold(m)
  2. %COLD    Black-Blue-Cyan-White Color Map
  3. %   COLD(M) returns an M-by-3 matrix containing a "cold" colormap
  4. %   COLD, by itself, is the same length as the current figure's
  5. %   colormap. If no figure exists, MATLAB creates one.
  6. %
  7. %   Example:
  8. %       imagesc(peaks(500))
  9. %       colormap(cold); colorbar
  10. %
  11. %   Example:
  12. %       load topo
  13. %       imagesc(0:360,-90:90,topo), axis xy
  14. %       colormap(cold); colorbar
  15. %
  16. % See also: hot, cool, jet, hsv, gray, copper, bone, vivid
  17. %
  18. % Author: Joseph Kirk
  19. % Email: jdkirk630@gmail.com
  20. % Release: 1.0
  21. % Date: 04/21/09

  22. if nargin < 1
  23.     m = size(get(gcf,'colormap'),1);
  24. end
  25. n = fix(3/8*m);

  26. r = [zeros(2*n,1); (1:m-2*n)'/(m-2*n)];
  27. g = [zeros(n,1); (1:n)'/n; ones(m-2*n,1)];
  28. b = [(1:n)'/n; ones(m-n,1)];

  29. cmap = [r g b];
复制代码


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|Mathematica中文论坛-非官方 ( 辽ICP备16001491号-1

GMT+8, 2024-12-29 07:15 , Processed in 0.099119 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表