废话不多说,直接附上code
影片含有程序码详细解说,若有误再烦请告知,谢谢
library(gapminder)
library(gganimate)
library(gifski)
library(dplyr)
data(gapminder)
gif <- gapminder %>%
ggplot(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() +
# new
labs(title = 'Year: {frame_time}', x = 'GDP per capita', y = 'life expectancy') +
transition_time(year) + #时间间隔,range = c(10L, 20L)
ease_aes('linear') #呈现效果
animate(gif, duration = 5, fps = 20,
width = 500, height = 300)
#duration 动画持续时间 fps每秒跳几张
anim_save("D:\\output.gif")
<<: The Truth of Rental Car Insurance Explained. Why & What?
>>: 三分钟就可以 CentOS 7 安装 LogAnalyzer
利用strcpy()将a字串里的文字复制到b字串,并将b的结果印出。 . . . . . #inc...
什麽是原型? JavaScript 这个语言有一个特性,所以资料其实都是以『物件』方式做建立,因此也...
为了提升 WordPress 站台安全性,我安装了防火墙及防毒外挂 Wordfence,此外挂提供了...
阿嬷都看得懂的满版横幅怎麽写与 normalize.css 昨天我们拿出了古早时代的贴纸簿,并且介绍...
昨日[Day 26]-【STM32系列】UART/USART TX 资料传送篇(上)我们体验了UAR...