View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Hatched Fill Patterns

4.8 | 29 ratings Rate this file 57 Downloads (last 30 days) File Size: 2.88 KB File ID: #1736 Version:
image thumbnail

Hatched Fill Patterns


Ben Hinkle (view profile)


24 May 2002 (Updated )

Replace solid colors with patterns.

| Watch this File

File Information

Will create a bitmap copy of a figure with distinct colors replaced with hatch patterns. This is useful for b+w bitmap output. Vector output is not supported.


This file inspired Polar Labels, Hatched Fill Patterns Plus, Boxplot C, Boxplot Csub (Boxplot C), Xticklabel Rotate, Hatch Fill Patterns Plus Plus, and Hatch Fill Patterns Plus Color & Invert.

MATLAB release MATLAB 5.3.1 (R11.1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (30)
03 Jan 2017 Ananya Malik

06 Mar 2015 Harsh

Harsh (view profile)

Will it only work for the bar plot? I tried with area but couldn't find what I was looking for?

Can you please share an example of functional usage?

Appreciate your help!

21 Aug 2014 chaks

chaks (view profile)

I am getting error while trying to use this function.
Lets say,
D=[26.834 16.74 12.37
20.238 18.84 14.201
21.523 15.14 12.25
22.839 14.64 13.57
22.8585 16.34 13.09775];
Please help me know how I can use applyhatch or makehatch to get a barplot in grayscale having hatched patterns.
Thank you,


17 Jun 2014 Ming

Ming (view profile)

Hi, I used this function and changed the colors of my bar plot to patterns, however, the background of the figure is always gray when copied. Where to change that?

25 Jul 2012 YANG ??

25 Jul 2012 YANG ??

This work is good, but not good enough, for bitmap will cause other trouble. I wish MATLAB will provide an offical version to overcome this shortage.

16 May 2012 J G

J G (view profile)

Can this work with 'area' plots?

22 Dec 2011 Jonathan C. Lansey

Great worked right out of the "box" thanks!

12 Oct 2011 Hua

Hua (view profile)

This is really a good thing!

15 Jul 2011 Qing Xie

15 Jul 2011 Qing Xie

26 Jun 2011 David

David (view profile)

Excellent, this is exactly what am I looking for.

22 Feb 2010 Rashed

Rashed (view profile)

Thanks a lot.

02 Feb 2010 K R

K R (view profile)

Thanks so much! This is so useful for black and white printing. One tip to users is to change the gcf color (color background) to white before applying the hatch. it seems once the hatch is applied the figure isn't able to be modified further.

29 Jun 2009 Oleg Komarov

Oleg Komarov (view profile)

I agree with Brian: this should be a built in feature in matlab. I always have to export data and do my graphs in excel.
Also, i think the "pointed" texture should be improved to match the logic it has in excel, that is it shouldn't simply make bigger points.

29 Jun 2009 Lucas

Lucas (view profile)

textures don't line up - but colour mapping is a good idea - Aha, i've found the problem, when the image is put into the figure, it is made _slightly_ bigger, giving the appearence (and output to file) of a bitmap with an extra line in its textures in the middle: lines 100 and 101 should read
set(newfig,'position',[fpos(1:2) figsize(3) figsize(4)]);
set(imaxes,'position',[0 0 figsize(3) figsize(4)],'visible','off');
i.e. remove the plus one

25 Apr 2009 Elena D

23 Oct 2008 Tobias Conradsson

This saved me a lot of work and time, thanks

Comment only
02 Aug 2008 vignesh ravi

08 Aug 2007 Jihun Jung

thanks alot! very useful one.

02 Aug 2007 Andreas E.

Works great!

01 Jun 2007 C.Safak SAHIN

Thanks, I started writing a code for it. After that, I found this program. I will be so helpful.

25 Oct 2005 Trond Kristiansen

Very useful! Graze!

23 Mar 2005 Guillermo Franco

Fantastic! Thanks!

15 Sep 2004 Mark Lilly

Needed to make black and white images for a paper and this utility saved the day. Highly reccommend!!! Thanks so much.

09 Jan 2004 Christopher Brown

Excellent. Can be easily modified to use custom fill patterns too.

01 Oct 2003 Mike Zierolf

Thanks a lot! This worked exactly as advertised.

18 Sep 2003 Danny Zhai

That is what I have been looking for! Nice job!

30 Jul 2003 Brian Katz

This should be included as a default feature in MatLab. A much needed function for producing any publications graphics.

28 May 2002 Denis Gilbert

The two m-files (APPLYHATCH and MAKEHATCH) address a long-standing shortcoming in the basic 2-D plotting capabilities of Matlab. Works well with PIE, BAR and CONTOURF.

Good job Ben !

14 Oct 2009 1.1

BSD update

24 Nov 2009 1.2

add 2002- to copyright

01 Sep 2016

Updated license

Contact us