読者です 読者をやめる 読者になる 読者になる

廿TT

譬如水怙牛過窓櫺 頭角四蹄都過了 因甚麼尾巴過不得

かけ算九九の表をグラフにしてみました

library(dplyr)
library(cowplot)
kuku <-data_frame(left=rep(1:9,each=9),right=rep(1:9,9)) %>% 
     mutate(ans=left*right)

ggplot(kuku,aes(x=factor(left),y=factor(right)))+
  geom_tile(aes(fill=ans))+
  geom_text(aes(label=ans))+
  scale_fill_continuous(low="white",high="cornflowerblue")+
  xlab("")+ylab("")+theme(legend.title = element_blank())

f:id:abrahamcow:20170407013639p:plain

ggplot(kuku,aes(x=1,y=ans))+
  geom_bar(stat = "identity")+
  facet_grid(right~left)+
  xlab("")+ylab("")+
  theme(legend.title = element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x = element_blank())

f:id:abrahamcow:20170407013650p:plain

ggplot(kuku,aes(x=factor(left),y=factor(right)))+
  geom_point(aes(size = ans))+
  xlab("")+ylab("")+
  theme(legend.title = element_blank())

f:id:abrahamcow:20170407013705p:plain