thomasp85 / ggfx

Filters and Shaders for 'ggplot2'
https://ggfx.data-imaginist.com
Other
167 stars 4 forks source link

with_outer_glow() - Negative values not shown #28

Open benbob-sci opened 1 year ago

benbob-sci commented 1 year ago

Labels with negative values passed to with_outer_glow, seem to lose their "-" sign.

See following example...

example contour plots

library(ggplot2) library(geomtextpath) library(ggfx) df <- expand.grid(x = seq(nrow(volcano)), y = seq(ncol(volcano))) df$z <- as.vector(volcano)-150 #make some values negative

this works - shows negative numbers

ggplot(df, aes(x, y, z = z)) + geom_contour_filled(bins = 6, alpha = 0.6) + geom_textcontour(bins = 6, size = 3, linetype = NA)

this doesn't work - negative numbers not shown

ggplot(df, aes(x, y, z = z)) + geom_contour_filled(bins = 6, alpha = 0.6) + with_outer_glow( geom_textcontour(aes(z = z), linetype = NA, size = 3), colour = 'white', expand = 5, sigma = 1 )

MartinMSPedersen commented 1 year ago

Not a problem here. Are you using the latest development version of ggfx or the CRAN version?