Skip to content

Instantly share code, notes, and snippets.

View martingraham's full-sized avatar

Martin Graham martingraham

View GitHub Profile
@martingraham
martingraham / EMFBitmapBGColour.r
Last active February 6, 2019 13:44
Change nasty black background to a nicer colour when emf transparency doesn't work
EMFBitmapBGColour <- function (filename, background = 0, replacementColour = -1) {
# by martin graham 6th feb 2019
# need to integerise these values explicitly or they change the type of id when inserted
# which then means mangled values are written back to file
background <- as.integer (background)
replacementColour <- as.integer (replacementColour)
# read emf file
fullFileName <- paste0(filename)