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 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by