███████
//Black on Black
//No: 16
Should Be Better
Original here

seen from Italy
seen from Singapore

seen from Malaysia
seen from Poland
seen from Netherlands

seen from Türkiye
seen from Russia

seen from Australia

seen from Romania

seen from Austria

seen from Algeria

seen from Germany

seen from Germany
seen from Türkiye

seen from Germany

seen from Malaysia
seen from China
seen from United States

seen from Algeria
seen from United States
███████
//Black on Black
//No: 16
Should Be Better
Original here
"Rainbow Stock Image"
Text with Outline for Annotating Plots
Sometimes you need to annotate a plot but the background may vary from light to dark, making the text invisible in some parts if it is white and in others if the text is black.
The other day I found this great snippet by Greg Snow to address this issue and I thought it was worth reproducing it here. It works very well and I have updated the code for the missing data patterns plot with it:
# From: Greg Snow # Subject: Re: Text Contrast in a Plot # Newsgroups: gmane.comp.lang.r.general shadowtext <- function(x, y=NULL, labels, col='white', bg='black', theta= seq(pi/4, 2*pi, length.out=8), r=0.1, ... ) { xy <- xy.coords(x,y) xo <- r*strwidth('A') yo <- r*strheight('A') for (i in theta) { text( xy$x + cos(i)*xo, xy$y + sin(i)*yo, labels, col=bg, ... ) } text(xy$x, xy$y, labels, col=col, ... ) }