Guest User

cold-to-hot color ramp

a guest
Nov 23rd, 2019
88
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. num = 64;
  2. v = linspace(-1,1,num);
  3.  
  4. if true
  5.     h = linspace(2/3,0,num)';
  6.     clr = hsv2rgb([h ones(num,2)]);
  7. else
  8.     clr = flipud(hsv(num));
  9. end
  10.  
  11. figure
  12. subplot(4,1,1), imagesc(v), colormap(clr), axis off, title('hsv')
  13. subplot(4,1,2:4), h = plot(v,clr); axis tight
  14. set(h(1), 'Color','r', 'LineWidth',3)
  15. set(h(2), 'Color','g', 'LineWidth',3)
  16. set(h(3), 'Color','b', 'LineWidth',3)
RAW Paste Data