|
Pete,
Thanks for your response. I'm not sure how overlaying a patch plot doesn't wipe out the black lines of the map, unless I give the patch plot an alpha value for transparency, which seems to be what your code does. However, I believe this compromises the original shades of color of the patch plot, right? It's important for me to keep that intact.
I will look into the bwtraceboundary solution. The map has quite complex lines. I assume this is immaterial?
This also still leaves unaddressed the problem of the transparency defaulting to black. When I do imshow(img w/transparent bg) with no other superposition, this always happens. Why does this go to black instead of white or the figure gray?
I believe I do have the image toolbox as well, if it makes a difference.
Thanks.
"Pete " <pete.dot.bankhead@btinternet.dot.com> wrote in message <glnomv$qe$1@fred.mathworks.com>...
> I've never tried to use image transparencies in MATLAB, so I don't know how to solve it that way. Can you do it the other way around - patch plot on top of the image?
>
> imshow(im, []);
> h = patch([10, 200, 200], [10, 10, 200], [1, 0 0]);
> set(h, 'FaceAlpha', .4, 'EdgeColor', 'none');
>
> If that means your patch vertices would have to be too accurate, you could load in a simple black and white image, use bwtraceboundary or bwboundaries to get the coordinates of the borders, and plot them on top using line. The image is then only used to get the coordinates, you don't actually display it. This would also give you control over how thick you want the borders to display and it could scale more nicely.
>
> The 'tracing object boundaries' part here might help:
> http://www.mathworks.com/access/helpdesk/help/toolbox/images/index.html?/access/helpdesk/help/toolbox/images/f11-11942.html
|