No BSD License  

Highlights from
drawShadedRectangle

5.0

5.0 | 5 ratings Rate this file 4 Downloads (last 30 days) File Size: 2.35 KB File ID: #6985
image thumbnail

drawShadedRectangle

by Martyn Dorey

 

23 Feb 2005 (Updated 02 Mar 2005)

Function creates a shaded rectangle.

| Watch this File

File Information
Description

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

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
11 Mar 2005 Arthur Mobile

Useful, thanks.

23 May 2005 T-Bone Williams

Works awesome...

30 Jan 2006 Julien Emile-Geay

I love it. It's phat.

19 Jul 2006 Youri Who  
20 Mar 2008 K Garrison

Just what I needed

Please login to add a comment or rating.
Updates
02 Mar 2005

Tidying up messy code

Tag Activity for this File
Tag Applied By Date/Time
annotation Martyn Dorey 22 Oct 2008 07:41:50
customization Martyn Dorey 22 Oct 2008 07:41:50
shading area Martyn Dorey 22 Oct 2008 07:41:50
interpolate Martyn Dorey 22 Oct 2008 07:41:50
color Martyn Dorey 22 Oct 2008 07:41:50
colour Martyn Dorey 22 Oct 2008 07:41:50
box Martyn Dorey 22 Oct 2008 07:41:50
fillarea Martyn Dorey 22 Oct 2008 07:41:50
chart Martyn Dorey 22 Oct 2008 07:41:50
bar Martyn Dorey 22 Oct 2008 07:41:50
shading Gautam Vallabha 17 Jun 2009 11:09:20
graphics Gautam Vallabha 17 Jun 2009 11:09:34
customization Bram 09 May 2011 04:59:11

Contact us at files@mathworks.com