【问题标题】:gganimate renders pixelated in windows 10gganimate 在 Windows 10 中渲染像素化
【发布时间】:2019-03-26 11:01:56
【问题描述】:

我必须使用 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')

我得到的是这样的:

【问题讨论】:

    标签: r animation ggplot2 gganimate


    【解决方案1】:

    你可以使用 options() 修改默认分辨率

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

    【讨论】:

      猜你喜欢
      • 2019-12-16
      • 2022-01-05
      • 2021-06-02
      • 1970-01-01
      • 2014-11-02
      • 1970-01-01
      • 2016-09-01
      • 2020-11-12
      • 1970-01-01
      相关资源
      最近更新 更多