Mathematica中文论坛-非官方

标题: 豆粑粑 matlab use matplotlib colormap [打印本页]

作者: meatball1982    时间: 2017-9-4 09:43
标题: 豆粑粑 matlab use matplotlib colormap

matlab import matplotlib colormap.
using "DrosteEffect-Colormaps-from-MatPlotLib2.0"


  1. fi_path= '/home/mm/works/work_matlab/mm_functions/DrosteEffect-Colormaps-from-MatPlotLib2.0/';
  2. fi_list=dir([fi_path,'*.m']);

  3. n_colmap= length(fi_list);

  4. [x,y,z]=peaks(30);

  5. sbp_width=0.9;
  6. sbp_heig=0.85;
  7. n_row = 3;
  8. n_col = 3;
  9. [out_pos]=fun_mm_subplot_pos(n_row,n_col,sbp_width,sbp_heig);
  10. h=figure(1)
  11. set(h, 'Position', [100, 100, 1200, 900]);


  12. for i = 1:n_colmap
  13.     ax=axes('position',out_pos(i,:));
  14.     surf(x,y,z,'edgecolor','none');
  15.     axis tight
  16.     col = fi_list(i).name;
  17.     col(end-1:end)=[];
  18. %     colormap(ax(i),col)
  19.     eval(['col_m=',col,'(16);']);
  20.     colormap(ax,col_m)
  21.     colorbar
  22.     title([col,'MPL'])
  23. end

  24. ax=axes('position',out_pos(9,:));
  25.     surf(x,y,z,'edgecolor','none');
  26.     axis tight
  27.     colormap(ax,'parula')
  28.     colorbar
  29.     title(['parula'])
  30. colorbar

  31. h=gcf;
  32. fig_na = './fig_col_name';
  33. fun_work_li_035_myfig_out(h,fig_na,3)
复制代码



DrosteEffect-Colormaps-from-MatPlotLib2.0-f506493.zip

28.91 KB, 下载次数: 0

matplotlib






欢迎光临 Mathematica中文论坛-非官方 (http://www.ilovemathematica.com/) Powered by Discuz! X3.2