我已经搜索了Google和其他人都说不支持。我想知道是否有任何开放的社区Matlab函数可以绘制用户定义的png作为标记。我找到的最接近的是http://de.mathworks.com/matlabcentral/fileexchange/39487-custom-marker-plot/content/plotCustMark/plotCustMark.m。但它不能达到预期的目的。如果可能的话,让我知道是否可以为此编写一些内容!谢谢。
额外的问题:好吧,我现在有这个奇怪的问题。我的png有黑色背景!!我不明白为什么。我试图降低alpha值,但还是不行。
解决方案:我在评论中提到的问题可以通过以下方法解决: http://de.mathworks.com/matlabcentral/answers/144411-displaying-image-over-background-making-top-image-background-color-transparent 方法:通过导入您的图像的透明度设置来解决。
额外的问题:好吧,我现在有这个奇怪的问题。我的png有黑色背景!!我不明白为什么。我试图降低alpha值,但还是不行。
解决方案:我在评论中提到的问题可以通过以下方法解决: http://de.mathworks.com/matlabcentral/answers/144411-displaying-image-over-background-making-top-image-background-color-transparent 方法:通过导入您的图像的透明度设置来解决。
[marker,map,transperancy ] = imread('car.png');
并稍后设置
handleIm = imagesc([x_low x_high], [y_low y_high], marker)
set(handleIm ,'AlphaData',transperancy);
澄清:这些图像原本都是透明的,但由于我将它们叠加在另一张图片上,导致当前图像的背景变成了默认的黑色。我发布了一个解决方案,我想这对很多人来说会非常有用。
h(k) = plot(...)
来获取绘制元素的句柄,并使用delete(h(k-1))
删除前一个标记。 - brainkz