How to set default background for figures to be negative

조회 수: 2 (최근 30일)
xiaojuezi
xiaojuezi 2020년 4월 13일
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에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by