Skip to main content


Showing posts from September, 2012

tikz for flow charts

\documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,shadows,arrows} \usetikzlibrary{backgrounds} \begin{document} %line thickness styles: ultra thin, very thin, (thin), semithick, thick, very thick, ultra thick %line dash styles: loosely dashed, densely dashed, loosely dotted, densely dotted \tikzstyle{decision}=[diamond,draw,fill=gray!50] %\tikzstyle{arrow}=[draw,-latex',very thick] \tikzstyle{arrow}=[draw,-latex'] \tikzstyle{line}=[draw] \tikzstyle{cloud}=[draw=gray!0,very thick,block,rounded corners,fill=gray!2, minimum width=15mm, minimum height=15mm,node distance=5em] \tikzstyle{vagueblock}=[draw=gray!30,rectangle,rounded corners,fill=gray!30,text centered, minimum width=15mm, minimum height=15mm,node distance=5em] \tikzstyle{block}=[draw,rectangle,rounded corners,fill=gray!30,text centered, minimum width=15mm, minimum height=15mm,node distance=5em] \tikzstyle{empblock}=[draw,rectangle,rounded corners,minimum width=8cm,minim

Example: Beeswarm plot in R

library(foreign) data <- read.dta("C:/Users/hellmund/Documents/MyStataDataFile.dta") names(data) install.packages('beeswarm') library(beeswarm) levels(data$group) png(file="C:/Users/hellmund/Documents/il6.png", bg="transparent") beeswarm(data$il6~data$group,data=data, method=c("swarm"),pch=16,pwcol=data$Gender,xlab='',ylab='il6',ylim=c(0,20)) legend('topright',legend=levels(data$Gender),title='Gender',pch=16,col=2:1) boxplot(data$il6~data$group, data=data, add = T, names = c("","",""), col="#0000ff22")

Solution: Stata's spagplot errorneously plots vertical lines

Stata's spagplot fails and plots vertical lines, but there is an easy solution in R. library(foreign) data <- read.dta("C:/Users/hellmund/Documents/MyStataDataFile.dta") names(data) levels(data$group) #First column contains initial measurements, k'th column measurements at time k dataLong <- reshape(data, direction="long", varying=list(names(data)[1:10]), v.names=NULL,idvar=c("id"), timevar="Visit", times=1:10) png(file="C:/Users/hellmund/Documents/spagplot.png", bg="transparent") interaction.plot(dataLong$Visit,dataLong$id, dataLong$Size xlab="Visit", ylab="Size(mm)", legend=F,lty=1, ylim=c(30,70)) #Critical cut-off value is marked with a horizontal line abline(h=55)

Udskiftning af digitizer på HTC Sensation XE

Min ældste datters mobil ramte fortorvet i en fælles forvirring - jeg tager det hændelige uheld på min kappe. Digitizeren splinteredes. Det så dyrt ud, men heldigvis virkede det bagvedliggende LCD display. Jeg fandt en løsning til under 250,- kroner fraregnet arbejdstiden! Replacement LCD and Touch screen   Nedenfor er et billede af resultatet. Min ældste datter kan få sin mobil igen her til sin fødselsdag :-) Det er den splinterede digitizer til venstre.

Example: Business cards typeset with LaTeX

So you enjoy the quality of a professional typesetting system? You got Avery labels, a working MikTeX and the ticket package installed... You might find some assistance from a half criminal paranoid zealot system administrator, willing to guide you through a dinosaur kingdom of TeX ... but that kind of assistance might also just leave you with nothing. It was easy to get the layout of the labels with the option zw32010, but how about page margins? I tried to set things straight with the layouts package (\usepackage{layouts}\currentpage \pagedesign), but then there was still some unwanted white space and margins... To make things less complicated I decided to make a single card. The solution is a hack because it needs customization (with voffset and hoffset as you see n the TeX code below) but the adjustment is more straightforward, especially if you use the boxed option with ticket. The card was converted to png with Ghostscript and I could easily print the business cards with A