drawShadedRectangle

版本 1.0.0.0 (882 字节) 作者: Martyn Dorey
Function creates a shaded rectangle.
2.1K 次下载
更新时间 2005/3/2

无许可证

Do you want to create box plots with shaded bars?
Do you want to fill the graph area before you plot?
Do you want an example which interpolates colour from left to right or up and down?

Your chart will look alot better if you fill the plot area before you chart.

Try this function to spice up your graph back grounds or create shaded 'control ranges' on a chart.

[hPatch, hLine] =drawShadedRectangle(vecXMinMax,vecYMinMax,vecC1,vecC2,vecC3,vecBorderColor,typeHorzVert)

For example:
drawShadedRectangle([0 3],[0 3],[0.95 0.95 1],[0.75 0.75 1],[0.95 0.95 1],[0 0 0.5],'horizontal')

will create a box 3x3 with a white/light blue/white gradient

hold on
drawShadedRectangle([0 1],[0.5 1],[0 0 0.5],[0.75 0.75 1],[0 0 0.5],[0 0 0.5],'horizontal')

Will draw a shaded bar above the background. So it looks just like an excel chart.

Enjoy,
Martyn

引用格式

Martyn Dorey (2024). drawShadedRectangle (https://www.mathworks.com/matlabcentral/fileexchange/6985-drawshadedrectangle), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R14SP1
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Bar Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Tidying up messy code