fig_clean | R Documentation |
fig_clean Removes color values close to white, also possible to remove text on plot, useful for gridlines on KM curves
fig_clean(fig.hsl, bg_lightness = 0.1, attempt_OCR = F, word_sensitivity = 30)
fig.hsl |
array of pixels in HSL format (hue/saturation/lightness) |
bg_lightness |
a lightness threshold value between 0 and 1; every pixel with lightness > bg_lightness is considered background and removed (default: 0.1). |
attempt_OCR |
a logical indicating whether to attempt text recognition (default: False) |
word_sensitivity |
A sensitivity percentage value for word recognition, potential pixel patterns are considered words if confidence > word_sensitivity (default: 30) |
fig.df: a dataframe with x,y and h,s,l values for each remaining pixel
# fig_clean(fig.hsl = figure, bg_lightness = 0.1, attempt_OCR = T, word_sensitivity = 30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.