How to set default background for figures to be negative
1 次查看(过去 30 天)
显示 更早的评论
I'm currently using matlab's rasterization functionality. After I plot a curve, I saved the whole image to a matrix using
img = print(gcf,'-r72','-RGBImage');
I set the default background as:
set (gcf, 'color', [0.0,0.0,0.0])
set(gcf, 'InvertHardcopy', 'off')
This gives [0,0,0] for every pixel in img. As I would like to distinguish my curve and the rest of the pixels, I would like to set
img(y,x,:) = [-1,-1,-1]
for all [y,x] that doesn't belong to my curve. In addition, I might have multiple curves, it would be tedious to check every curve. The optimal would be pre-settting each position with a negative value and update the positions where the curves lie.
As my curve has a varying color, it is not possible to directly mark the curve. Would there be any way to set the background like this?
Thank you very much!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!