【发布时间】: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