- 1、本文档共15页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Matlab中画有阴影的柱状图
在画柱状图时,利用不同的颜色区分在实际打印时经常区分不出。 为了能够更清楚第表示最终结果,可采用在柱状图中打阴影的方式来表示。
然而,Matalab本身没有提供实现这种功能的函数库。
下面两个函数:
% Apply Brandons function
applyhatch_pluscolor
% Apply Brians function
applyhatch_plusC(fH, \-x., rkbk);
实现了上述功能。
这两个函数中都调用了函数makehatch_plus 源码如下(都已经调试通过,可方便使用)。
fH = gcf; colormap(jet(4));
h = bar(rand(3, 4));
legend(Apple, Orange, Banana, Melon, Location, EastOutside);
% Apply Brandons function
tH = title(Brandons applyhatch);
applyhatch_pluscolor(fH, \-x., 0, [1 0 1 0], jet(4));
% Apply Brians function
set(tH, String, Brians applyhatch);
applyhatch_plusC(fH, \-x., rkbk);
set(tH, String, Original);
代码源自:
/matlabcentral/fileexchange/24021-hatch-fill-patterns-plus-color-invert/content/applyhatch_pluscolor.m
function [im_hatch,colorlist] = applyhatch_pluscolor(h,patterns,CvBW,Hinvert,colorlist, ...
dpi,hatchsc,lw)
%APPLYHATCH_PLUSCOLOR Apply hatched patterns to a figure in BW or Color
% APPLYHATCH_PLUSCOLOR(H,PATTERNS) 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, ., c, w, k
% (see makehatch_plus.m for more details) or
% a cell array of matrices of zeros (white) and ones (black)
%
% In addition, H can alternatively be a uint8 NxMx3 matrix of the type
% produced by imread. In this case, colors in this image will be
% replaced with patterns as if it was a figure. A final figure window
% will be generated that displays the result. The DPI argument
% discussed below will be ignored if H is an image matrix.
%
% APPLYHATCH_PLUSCOLOR(H,PATTERNS,CVBW) binary value for choice of Color or Black
% and White plots. If color is chosen the color will match that of the
% current fill. 1 - Color, anything else - BW
%
% APPLYHATCH_PLUSCOLOR(H,PATTERNS,CVBW,HINVERT) binary value to invert the hatch.
% i.e., if it is black lines with a white background, t
您可能关注的文档
最近下载
- 《指向高中生物核心素养的大单元教学设计研究》课题研究方案.doc
- Unit 4 What can you do Part C Story time(课件)-人教PEP版英语五年级上册.pptx VIP
- 学生会权益部部门招新.pptx VIP
- 《22G101三维彩色立体图集》.pdf VIP
- 一种快速测定萤石中氟化钙含量的方法.pdf VIP
- 人教版六年级数学上册同步辅导讲义教师版.doc
- 2025高中英语外刊时文阅读 巴黎奥运会之全红婵和潜水介绍 课件.pptx
- 植物生理学-扬州大学-中国大学MOOC慕课答案.pdf
- 三论我国发展注气提高采收率技术-李士伦.ppt
- 人教版六年级数学上册同步辅导讲义.doc
文档评论(0)