Hatchfill certain area under curve: findobj
Show older comments
Hi,
I was wondering how to get the area left to the line where the mean is hatched in color using hatchfill2 function:
x = [-3:.1:3];
norm = normpdf(x,0,1);
figure;
plot(x,norm)
y1 = get(gca,'ylim');
hold on
plot([mean(norm) mean(norm)],y1)
Thanks in advance!
Accepted Answer
More Answers (1)
peterhack
on 19 Jun 2016
0 votes
1 Comment
Walter Roberson
on 19 Jun 2016
patch objects have CData and FaceVertexCData properties. The two affect coloring in different ways, with the vertex based one being more powerful in some ways.
The output of hatchfill is line objects, which do have a Color property.
Categories
Find more on Polygons in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!