91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-23
  • 語言: Matlab
  • 標簽:

資源簡介

MATLAB實現數據的無顏色柱狀圖,滿足一些期刊論文只能黑白打印

資源截圖

代碼片段和文件信息

function?applyhatch(hpatternscolorlist)
%APPLYHATCH?Apply?hatched?patterns?to?a?figure
%??APPLYHATCH(HPATTERNS)?creates?a?new?figure?from?the?figure?H?by
%??replacing?distinct?colors?in?H?with?the?black?and?white
%??patterns?in?PATTERNS.?The?format?for?PATTERNS?can?be
%????a?string?of?the?characters?‘/‘?‘‘?‘|‘?‘-‘?‘+‘?‘x‘?‘.‘
%????a?cell?array?of?matrices?of?zeros?(white)?and?ones?(black)
%
%??APPLYHATCH(HPATTERNSCOLORS)?maps?the?colors?in?the?n?by?3
%??matrix?COLORS?to?PATTERNS.?Each?row?of?COLORS?specifies?an?RGB
%??color?value.
%
%??Note?this?function?makes?a?bitmap?image?of?H?and?so?is?limited
%??to?low-resolution?bitmap?output.
%
%??Example?1:
%????bar(rand(34));
%????applyhatch(gcf‘-x.‘);
%
%??Example?2:
%????colormap(cool(6));
%????pie(rand(61));
%????legend(‘Jan‘‘Feb‘‘Mar‘‘Apr‘‘May‘‘Jun‘);
%????applyhatch(gcf‘|-+./‘cool(6));
%
%??See?also:?MAKEHATCH

%??By?Ben?Hinkle?bhinkle@mathworks.com
%??This?code?is?in?the?public?domain.?
??
oldppmode?=?get(h‘paperpositionmode‘);
oldunits?=?get(h‘units‘);
set(h‘paperpositionmode‘‘auto‘);
set(h‘units‘‘pixels‘);
figsize?=?get(h‘position‘);
if?nargin?==?2
??colorlist?=?[];
end
bits?=?hardcopy(h‘-dzbuffer‘‘-r0‘);
set(h‘paperpositionmode‘oldppmode);

bwidth?=?size(bits2);
bheight?=?size(bits1);
bsize?=?bwidth?*?bheight;
if?~isempty(colorlist)
??colorlist?=?uint8(255*colorlist);
??[colorscolori]?=?nextnonbw(0colorlistbits);
else
??colors?=?(bits(::1)?~=?bits(::2))?|?...
???????????(bits(::1)?~=?bits(::3));
end
pati?=?1;
colorind?=?find(colors);
while?~isempty(colorind)
??colorval(1)?=?bits(colorind(1));
??colorval(2)?=?bits(colorind(1)+bsize);
??colorval(3)?=?bits(colorind(1)+2*bsize);
??if?iscell(patterns)
????pattern?=?patterns{pati};
??elseif?isa(patterns‘char‘)
????pattern?=?makehatch(patterns(pati));
??else
????pattern?=?patterns;
??end
??pattern?=?uint8(255*(1-pattern));
??pheight?=?size(pattern2);
??pwidth?=?size(pattern1);
??ratioh?=?ceil(bheight/pheight);
??ratiow?=?ceil(bwidth/pwidth);
??bigpattern?=?repmat(pattern[ratioh?ratiow]);
??if?ratioh*pheight?>?bheight
????bigpattern(bheight+1:end:)?=?[];
??end
??if?ratiow*pwidth?>?bwidth
????bigpattern(:bwidth+1:end)?=?[];
??end
??bigpattern?=?repmat(bigpattern[1?1?3]);
??color?=?(bits(::1)?==?colorval(1))?&?...
??????????(bits(::2)?==?colorval(2))?&?...
??????????(bits(::3)?==?colorval(3));
??color?=?repmat(color[1?1?3]);
??bits(color)?=?bigpattern(color);
??if?~isempty(colorlist)
????[colorscolori]?=?nextnonbw(coloricolorlistbits);
??else
????colors?=?(bits(::1)?~=?bits(::2))?|?...
?????????????(bits(::1)?~=?bits(::3));
??end
??colorind?=?find(colors);
??pati?=?(pati?+?1);
??if?pati?>?length(patterns)
????pati?=?1;
??end
end

newfig?=?figure(‘units‘‘pixels‘‘visible‘‘off‘);
imaxes?=?axes(‘parent‘newfig‘units‘‘pixels‘);
im?=?image(bits‘parent‘imaxes);
fpos?=?get(newfig‘position

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????4600??2018-03-28?15:48??柱狀圖\applyhatch.m

?????文件?????????75??2018-03-28?16:07??柱狀圖\readme.txt

?????文件????????356??2018-03-28?16:02??柱狀圖\zhuzhuangtu.m

?????目錄??????????0??2018-03-28?16:05??柱狀圖

-----------?---------??----------?-----??----

?????????????????5031????????????????????4


評論

共有 條評論

相關資源