Rank: 987 based on 139 downloads (last 30 days) and 1 file submitted
photo

Neil Tandon

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by Neil Tandon
Updated   File Tags Downloads
(last 30 days)
Comments Rating
19 Dec 2012 Screenshot Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon plot, patch, hatch, speckle, hatching, fill 139 20
  • 4.85714
4.9 | 8 ratings
Comments and Ratings by Neil Tandon 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 Tandon's Files View all
Updated File Comment by Comments Rating
24 Nov 2014 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon dpb

ADDENDUM/ERRATUM -- Spoke slightly too soon...
The fixup given below _does_ solve the legend handle; it for some reason I don't yet full understand trashes the patch regions in the figure, however. Best I've done to date is to add yet another conditional...replace the calls to line() w/ the conditional

if gca==hax
H(j) = line(xhatch,yhatch);
else
H(j) = plot(hax,xhatch,yhatch);
end

Also, to prevent changes in y-scale found it necessary to clip the yhatch array returned from hatch_xy(). I put it after the call in the calling routine rather than take the time/trouble to pass the limits or handle to hatch_xy()

[xhatch,yhatch] = hatch_xy(x,y,STYL,ANGLE,SPACING);
% clip limits within the axes limits
ylm=ylim(hax);
yhatch(yhatch<ylm(1))=ylm(1);
yhatch(yhatch>ylm(2))=ylm(2);

This was necessary in my case as there were -eps or thereabouts values returned and with the lower axis at 0 for the bar chart it turned the lower axis limit to -1 instead. That's just rude... :)

Don't think it can hurt in general altho is only needed for cases like this of hatching the boundary region.

23 Nov 2014 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon dpb

R2012b doesn't draw legends correctly; not sure about earlier releases or later.

Fails owing to use of line() primitive which can't take an axis object and uses current axes by default. Can't force legend object to be current axes.

Fixup is to turn the two line() calls

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

with

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

Still needs the fixup of twimmeh as well, of course.

24 Oct 2014 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon Ben

It would be great if there was a mapping version of Hatchfill, perhaps "Hatchfillm" for hatching "patchm" objects? Hatchfill doesn't appear to work on map axes.

13 Mar 2014 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon Edward Byers

Modifications that twimmeh describes are highly recommended - thanks!

12 Sep 2013 Hatchfill Fills an area with hatching or speckling. Author: Neil Tandon David

Very useful file, but I'm having some trouble with the speckling. I'd like to be able to fill a contour with dots, not just outline it. It would be nice if the function were able to do this by itself instead of the user having to, through trial and error.

Contact us