File Exchange Pick of the Week

September 22nd, 2004

Colorbars for filled contours

This weeks pick adds very useful functionality for anybody who works with filled contour plots (as created by contourf). MATLAB's standard colorbar isn't particularly well suited to filled contours, since it displays ever color in the colormap while the filled contour plot uses a smaller subset of colors. Blair Greenan's COLORBARF creates a colorbar that displays only the colors contained in the filled contour plot. The figures below show the difference between COLORBAR and COLORBARF: colorbarft.png One tiny caution if you are using MATLAB 7 (R14). To ensure compatibility with COLORBARF, use the new 'v6' flag when calling CONTOURF, e.g. [cout,H]=contourf('v6',peaks); colorbarf(cout,H) One more thing - are you impressed that I made it through this entire posting without making a snide comment about the name Blair chose for this function?

Comments are closed.


MathWorks

Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

These postings are the author's and don't necessarily represent the opinions of The MathWorks.