Plot a hatched data set over a contour plot
4 次查看(过去 30 天)
显示 更早的评论
Hi everybody,
I am trying to implement a solution that has already been dicussed in another question. I have a contour map on top of which I'd like to hatch all values of another contour higher than a certain threshold.
This is the current plot:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/313493/image.png)
I have population data (with the same meshgrid as the already plotted contour). I'd like to mark regions with high population density and regions with even higher densities.
I keep getting the error "Unsupported graphics handle type." on the fourth last of those lines:
At the moment this is the code:
[~, h2]=contourf(xll, yll, concTotal, [1.5 1.5], 'linecolor', 'none'); % tbh i don't understand what the [1.5 1.5] does. Is this where I could set the thresholds?
set(h2,'linestyle','none','Tag','HatchingRegion','fill','off');
hp = findobj(h2,'Tag','HatchingRegion');
hh = hatchfill2(hp,'cross','LineWidth',1,'Fill','off');
[~, hContour]=contourf(xll, yll, concTotal, levels, 'linecolor', 'none'); % this is the already plotted contour
colormap
colorbar
I wish I'd manage to understand the problem myself, but I am pretty new to matlab.
Thanks in advance for some help.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!