gganimate визуализирует пиксели в windows 10 - PullRequest
0 голосов
/ 22 октября 2018

Я должен визуализировать некоторые анимации, используя gganimate, но изображения выглядят не очень хорошо.Они не имеют четкости, а границы имеют пиксели.Есть ли способ получить лучшие результаты в Windows 10?

Мой код:

library(gapminder)
library(ggplot2)
library(gganimate)
Cairo(600, 600, file="plot.png", type="png", bg="white")
ggplot(gapminder,aes(gdpPercap, lifeExp, size = pop, colour = country)) +
  geom_point(alpha = 0.7, show.legend = FALSE) +
  scale_colour_manual(values = country_colors) +
  scale_size(range = c(2, 12)) +
  scale_x_log10() +
  facet_wrap(~continent) +
  # Here comes the gganimate specific bits
  labs(title = 'Year: {frame_time}', x = 'GDP per capita', y = 'life expectancy') +
  transition_time(year) +
  ease_aes('linear')

Что я получаю это:

enter image description here

1 Ответ

0 голосов
/ 22 октября 2018

Вы можете изменить разрешение по умолчанию с помощью параметров ()

options(gganimate.dev_args = list(width = 5, height = 7, units = 'in', res=320))
...