knitr::opts_chunk$set(echo = TRUE)
library(gogamer)
library(magrittr)

Changing target width

plotat(saikoyo, 116, targetwidth = 5)
plotat(saikoyo, 116, targetwidth = 10)
plotat(saikoyo, 116, targetwidth = 3)

Changing colors

plotat(saikoyo, 116, boardcolor = "pink",
       blackcolor = "green", whitecolor = "orange")

Remove axis label

plotat(saikoyo, 116, axislabels = FALSE)

Various board size

ggoban(13) %>% addstones(c(7, 8, 1), c(7, 7, 1), c(1, 2, 1))
ggoban(9) %>% addstones(c(5, 6, 1), c(5, 5, 1), c(1, 2, 1))
ggoban(13, axislabels = FALSE) %>% addstones(c(7, 8, 1), c(7, 7, 1), c(1, 2, 1))
ggoban(9, axislabels = FALSE) %>% addstones(c(5, 6, 1), c(5, 5, 1), c(1, 2, 1))

Territory plot

x <- read_sgf("../../tests/testthat/multiend.sgf")
plotat(x, 100, markpoints = TRUE)
plotat(x, 100, markpoints = TRUE, marklast = FALSE, territoryshape = 22)
plotat(x, 100, markpoints = TRUE, blackcolor = "blue", whitecolor = "red")
plotat(x, 100, markpoints = TRUE, marklast = FALSE, axislabels = FALSE,
       boardcolor = "grey95", whitecolor = "white", blackcolor = "black")

Test for color themes

plotat(saikoyo, 116, colortheme = "standard")
plotat(saikoyo, 116, colortheme = "dark")
plotat(saikoyo, 116, colortheme = "bw")
plotat(saikoyo, 116, colortheme = "pastel")
plotat(saikoyo, 116, colortheme = "crystal")

Kifu image

Setting arbitrary start number

kifu(saikoyo, 11, 20, restart = 1) %>% plot()

Deduct multiple of hundred if appropriate, or disable it

kifu(saikoyo, 99, 120) %>% plot()
kifu(saikoyo, 100, 120) %>% plot()
kifu(saikoyo, 101, 120) %>% plot()
kifu(saikoyo, 199, 220) %>% plot()
kifu(saikoyo, 200, 220) %>% plot()
kifu(saikoyo, 201, 220) %>% plot()
kifu(saikoyo, 201, 220) %>% plot(adjustorigin = FALSE)

without footnote

kifu(saikoyo) %>% plot()
kifu(saikoyo) %>% plot(axislabels = FALSE)

with footnote

# fig.width=5, fig.height=5.6
kifu(mimiaka) %>% plot()
kifu(mimiaka) %>% plot(axislabels = FALSE)
y <- read_sgf("../../tests/testthat/ko.sgf")
kifu(y, 1, 108) %>% plot()
# check for numbers in the note
kifu(y, 101, 108) %>% plot()
kifu(y, 101, 108) %>% plot(axislabels = FALSE)

For smaller board

# fig.width=5, fig.height=5.96
z <- read_sgf("../../tests/testthat/ko9.sgf")
kifu(z) %>% plot()

For smaller board with size in the footnote adjusted

# fig.width=5, fig.height=7.58
kifu(z) %>% plot(adjustsizeonnote = TRUE, moveperrow = 4)

With various number of lines

kifu(z, 1, 15) %>% plot()
# fig.width=5, fig.height=5.6
# fig.width=5, fig.height=5.78
kifu(z, 5, 40) %>% plot()
# fig.width=5, fig.height=5.78
kifu(z, 3, 12) %>% plot(adjustsizeonnote = TRUE, moveperrow = 4)
# fig.width=5, fig.height=6.5
kifu(z, 3, 40) %>% plot(adjustsizeonnote = TRUE, moveperrow = 4)

with color themes

kifu(mimiaka) %>% plot(colortheme = "dark")
kifu(mimiaka) %>% plot(colortheme = "bw")
kifu(mimiaka) %>% plot(colortheme = "pastel")
kifu(mimiaka) %>% plot(colortheme = "crystal")

Partial board

a <- read_sgf("../../tests/testthat/tsumego1.sgf")
b <- read_sgf("../../tests/testthat/tsumego2.sgf")
d <- read_sgf("../../tests/testthat/joseki.sgf")
plotat(a, 0, xlim = c(1, 7), ylim = c(1, 10), targetwidth = 3) 
kifu(a, 1, 5) %>% plot(xlim = c(1, 10), ylim = c(1, 9))
plotat(b, 0, xlim = c(1, 9), ylim = c(1, 10))
kifu(b, 1, 9) %>% plot(xlim = c(1, 9), ylim = c(1, 10))
kifu(b, 1, 9) %>% plot(xlim = c(1, 9), ylim = c(1, 10), axislabels = FALSE)
plotat(d, 10, xlim = c(9, 19), ylim = c(9, 19), targetwidth = 3) 


kota7/gogamer documentation built on May 20, 2019, 1:10 p.m.