get_color.m

来自「基于Matlab的地震数据处理显示和测井数据显示于处理的小程序」· M 代码 · 共 27 行

M
27
字号
function col=get_color(index,colors)% Function gets the color symbol associated with index "index"% Colors are ['r';'g';'b';'k';'y';'c';'m']% For index > 7 the colors are repeated, but with dashes, then with dots;% thereafter the process repeats itself (ge_color(22) is 'r' again%% Written by: E. R.:% Last updated: April 2, 2004: use dots in addition to dashes%%         col=get_color(index,colors)% INPUT% index   index for which color symbol is requested% colors  optional sequence of colors; %         Default: colors={'r','g','b','k','c','m','y', ...%                          'r--','g--','b--','k--','c--','m--','y--', ...%                          'r:','g:','b:','k:','c:','m:','y:'}% OUTPUT% col     string with color symbolif nargin == 1   colors={'r','b','g','k','c','m','y', ...   'r--','g--','b--','k--','c--','m--','y--', ...   'r:','g:','b:','k:','c:','m:','y:'};endcol=colors{mod(index-1,length(colors))+1};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?