Skip to content
Prev 395265 / 398502 Next

Plot to a device and examine the plot?

Let me clarify my question:

plot.new()
polygon(c(.5, .5, .75, .8), c(.25, .3, .4, .5))

If the device is an on-screen device, can I check whether a particular area
has anything drawn on it, or, to be precise, whether the color of a
particular area has all pixels equal to the background color. That is, if
the background is white, can I know whether a particular area is white?

E.g.,  in the case above, the area bounded by rect(0, 0, .25, .25) is
completely white, while the area bounded by rect(0, 0, .75, .75) is not
because part of border of the polygon, black by default, has been drawn in
this area.

If the device is an image file, then I can check the color of a pixel. I
would like to know whether I can do the same with an on-screen device.

Thanks.

Regards,
Shu Fai


On Sun, Oct 15, 2023 at 11:44?PM Shu Fai Cheung <shufai.cheung at gmail.com>
wrote: