ropensci / visdat

Preliminary Exploratory Visualisation of Data

Home Page:https://docs.ropensci.org/visdat/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Background of vis_miss() plot is transparent when saving to file

philsf opened this issue · comments

Hi, whenever I try to save a plot from vis_miss() to file, the background of the PNG is transparent, which makes it very hard to understand the elements. Attached are a screenshot of what I get and the actual file that was created.

airquality %>% vis_miss()
ggsave("air.png", h = 4, w = 4)

Screenshot of how it looks when I open the PNG.
image

The actual PNG file created from vis_miss().
air

EDIT I just found out that this does not happen if I save to a JPG (which I don't normally use). Perhaps this issue is exclusive to the PNG format?

Hi there - yes you are correct! That is an issue with PNG images vs other formats - PNG will add transparency by default, I think there's a way to not do that, but I'm not 100% sure how to do it. All the best!