This routine will shade the area of a 2-D plot between two user defined vectors. Simply pass the two vectors, and their corresponding horizontal coordinates, select your fill color and transparency level and viola! You have a figure that is colored in between the two input vectors.
Very nice. But because of the transparancy, Matlab switches to OpenGL, which leads to vanishing axis. To avoid that I just make the axis lines thicker set(gca,'LineWidth',1.0).
Because logarithmic plots do not support OpenGL, you can not draw transparant areas in logarithmic plots.
This function is great, thanks very much. I was hoping to use it to highlight the time-periods for which there was a statistical difference between the two lines. After creating the basic plot, I created a new matrix which specifies the time-points of interest (statistcially significant) in the first column, and the relevant data points for the two lines in the 2nd and 3rd column. I then ran jbfill on this. Unfortunately because the periods of interest are non-contiguous the function fills in the area in between. Is there a way to make it so that it wil only shade in areas at the specific time-points I have specified?
the "transparancy" option comes with a caveat: it will switch the renderer to opengl. After that, a vector export is not possible anymore (matlab limitation). set to 1.0 to avoid this problem.
thank you!!!! this came in REALLY handy! easy to use, well documented! :)
05 Sep 2008
Very, very helpful and extremely easy to use. Great for confidence intervals!
06 Aug 2008
Great. This was very helpful and saved me lots of time to figure out the exact work that you've done. Thanks!
On another note, I need a few vector-couples the area between which need to be shadded, on the same plot. How can I incorporate that?
26 May 2008
Good file, but the colour disappears when I switch to a vertical log scale. How can I fix this?
07 May 2008
Thanks, exactly what I needed!
Also thanks to Chris: put data in row vectors!
13 Mar 2008
if you make I run the following example, matlab logs me off my user account on SuSe 10.2
% copy the jbfill.m example from the comments here.
20 Feb 2008
W. H. Brave
Very good file, thank you.
06 Feb 2008
lovely function but it is removing box around figure as consequence of transparency.
08 Dec 2007
Great job. Thanks for all.
02 Oct 2007
Just what I needed. Thanks!
31 Aug 2007
Exactly what I needed. Thanks for posting!
01 Aug 2007
13 Mar 2007
Very nice. Thanks!
19 Jan 2007
Works great, but apparently only when datapoint are horizontally organized (one row). If it's a column it doesn't work. You could mention this in the file.