HOME    BOOKS   ONE-DAY COURSE   ET NOTEBOOKS   SCULPTURE   PRINTS   POSTERS, GRAPH PAPER   ABOUT ET 
  CART

 
All 4 books by Edward Tufte now in
paperback editions, $100 for all 4
Visual Display of Quantitative Information
Envisioning Information
Visual Explanations
Beautiful Evidence
Paper/printing = original clothbound books.
Only available through ET's Graphics Press:
catalog + shopping cart
All 4 clothbound books, autographed by the author $150
catalog + shopping cart
Edward Tufte e-books
Immediate download to any computer:
Die visuelle Darstellung quantitativer
Informationen, 200 Seiten, $12
数量情報の視覚的表示
(200 ページ)、$12
A exibição visual das informações
quantitativas 200 pãginas $12
Visualizzare l'informazione quantitativa
200 pagine $12
《量化資訊的視覺顯示》200 頁 $12
La représentation de l'information
quantitative 200 pages $12
La Representación Visual de Información
Cuantitativa 200 páginas $12
Visual and Statistical Thinking $2
The Cognitive Style of Powerpoint $2
Seeing Around + Feynman Diagrams $2
Data Analysis for Politics and Policy $2
catalog + shopping cart
Edward Tufte one-day course,
Presenting Data and Information
Arlington, May 23, 24, 25
Philadelphia, June 21
New York, June 23, 24
Hartford, June 27
Seattle, July 25, 26
Portland, July 28
Response to Sparklines: computer code implementation

Here is a simple R implementation of sparklines. Running sparkline() will generate a random sparkline; running sparkline(yourdata) will generate a sparkline using the data in yourdata. As an example, here is Google's stock price for the last year.

#R sparklines
sparkline<-function(ydata=rnorm(100,500,50),width=1.5,height=0.5,sigfigs=4) {

# ydata = vector of data to be plotted
# width = width of sparlkline in inches, including text
# height = height of sparkline in inches
# sigfigs = number of significant figures to round min, max, and last values to

	temppar<-par(no.readonly = TRUE) # store default graphics parameters
	par(mai=c(0.10,0.05,0.10,0.05),fin=c(width,height)) # adjust graphics parameters for sparklines
	len<-length(ydata) # determine the length of the data set
	ymin<-min(ydata) # determine the minimum
	tmin<-which.min(ydata) # and its index
	ymax<-max(ydata) # determine the maximum
	tmax<-which.max(ydata) # and its index
	yfin<-signif(ydata[len],sigfigs) #determine most recent data point
	plotrange=c(ymin-0.3*(ymax-ymin),ymax+0.3*(ymax-ymin)) # define plot range to leave enough room for min and max circles and text
	plot(x=1:len,y=ydata,type="l",xlim=c(1,len*1.5),ylim=plotrange,col="gray",lwd=0.5,ann=FALSE,axes=FALSE) # plot sparkline
	points(x=c(tmin,tmax),y=c(ymin,ymax),pch=19,col=c("red","blue"),cex=0.5) # plot min and max points
	text(x=len,y=ymin,labels=signif(ymin,sigfigs),cex=0.5,pos=4,col="red") # show minimum value
	text(x=len,y=ymax,labels=signif(ymax,sigfigs),cex=0.5,pos=4,col="blue") # show maximum value
	text(x=len,y=(ymin+ymax)/2,labels=yfin,cex=0.5,pos=4) # show most recent value
	par(temppar) # restore graphics defaults
}

-- Jason Dieterle (email)