## ----setup, include=FALSE--------------------------------------------------------------------------------------------------------------------- knitr::opts_chunk$set(echo = TRUE) old_opt = options( width=144 ) # if( !file.exists("figs") ) dir.create("figs") require("rgl",quietly=TRUE) rgl::setupKnitr(autoprint = TRUE) ## ----echo=TRUE, message=FALSE---------------------------------------------------------------------------------------------------------------- library(zonohedra) ## ----echo=TRUE, message=TRUE, warning=TRUE, fig.width=6.5, fig.height=4, fig.cap='Figure 2.1 four points in the 2-transition complex, visualized with bar graphs', out.width="100%", cache=FALSE---- mybarplot <- function( x ) { n = length(x) plot( c(0,n), c(0,1), type='n', tcl=0, las=1, xaxt='n', xlab='', ylab='', mgp=c(3,0.25,0) ) grid( nx=NA, ny=NULL, lty=1 ) barplot( x, names.arg=1:n, space=0, add=T, yaxt='n', mgp=c(3,0.25,0) ) } x1 = numeric(10) ; x1[ c(3,8) ] = exp( c(-0.25,-1) ) ; x1[ 4:7 ] = 1 x2 = numeric(10) ; x2[ c(5,6) ] = exp( c(-1,-0.25) ) oldpar = par( mfrow=c(2,2) , omi=c(0,0,0,0), mai=c(0.45,0.5,0.1,0) ) mybarplot( x1 ) ; mybarplot( x2 ) # row #1 mybarplot( 1-x1 ) ; mybarplot( 1-x2 ) # row #2 par( oldpar ) ## ----echo=TRUE, message=TRUE, warning=TRUE, fig.width=6.5, fig.height=4, fig.cap='Figure 2.2', out.width="100%", cache=FALSE---------------- mystepplot <- function( x ) { # assumption: x is Type I n = length(x) plot( c(1/2,n+1/2), c(0,1), type='n', tcl=0, las=1, xlab='', ylab='', lab=c(n,5,7), mgp=c(3,0.25,0) ) grid( lty=1 ) beta = seq(1/2,n+1/2,by=1) ; segments( beta, 0, beta, -0.02 ) ij = which( 0