Rank: 1275 based on 70 downloads (last 30 days) and 1 file submitted
photo

Neil Tandon

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Neil
Updated   File Tags Downloads
(last 30 days)
Comments Rating
19 Dec 2012 Screenshot Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon hatch, plot, patch, speckle, fill, hatching 70 13
  • 5.0
5.0 | 3 ratings
Comments and Ratings by Neil View all
Updated File Comments Rating
18 Dec 2012 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon

Thank you Dan, I added an additional check for axes that are only one level up.

17 Jul 2012 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon

Matt - you could try something like...
h = legend('patch1','patch2');
hp = findobj(h,'type','patch');
hatchfill(hp(1));
hatchfill(hp(2));

25 Jul 2011 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon

Thanks Dmytro. I fixed this bug.

Comments and Ratings on Neil's Files View all
Updated File Comment by Comments Rating
03 May 2013 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon Bendix

Seems like a really great tool but unfortunately I don't manage to get it working for the problem I needed it for:

I have a 2D-matrix of linear trends (slopes) and a logical 2D-matrix of the same size telling whether the trend is significant at position xy. Now I'd like to hatch the regions of (no) significance in a contourf or pcolor plot.
Has anyone any hint why it does not work in this case although I get it working in other cases?

Would be very grateful for help.
Cheers

02 May 2013 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon twimmeh

aaaand if you want the aspect ratio of the hatch pattern to be correct you need to pass the axes handle to the hatch_xy function and replace calls to gca.

nasty, but works:

function [xi,yi,x,y]=hatch_xy(hax,x,y,varargin);
gca = hax;

(and of course updating the relevant hatch_xy call line)

02 May 2013 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon twimmeh

I _believe_ the problem with legend hatching is that the lines are being drawn on the wrong axes.

If you adjust the calls to 'line' in the function to specify the axes parent then it seems to work... at least for me (R2011b).

-----------------------------------------

H(j) = line(xhatch,yhatch,'marker','.','linest','none', ...
'markersize',specksize,'color',linec,'parent',hax);

and

H(j) = line(xhatch,yhatch,'parent',hax);

-----------------------------------------

%My legend code:

hLegend = legend(...);
hp = findobj(hLegend, 'Type', 'patch');
hatchfill(hp)

This assumes you have only one patch; you need to specify hp(i) in the hatchfill call when there are multiple patches. Also, I've found you need to increase the SPACING parameter for it to look good.

22 Feb 2013 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon Nearing, Grey

I am also curious whether it is possible to get a hatch symbol in the legend. The fix Neil suggested on Jul 17 is not working for me.

18 Dec 2012 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon Tandon, Neil

Thank you Dan, I added an additional check for axes that are only one level up.

Top Tags Applied by Neil
fill, hatch, hatching, patch, plot
Files Tagged by Neil
Updated   File Tags Downloads
(last 30 days)
Comments Rating
19 Dec 2012 Screenshot Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon hatch, plot, patch, speckle, fill, hatching 70 13
  • 5.0
5.0 | 3 ratings

Contact us