[R] dotplot with library lattice
Jim Lemon
jim at bitwrit.com.au
Sat Oct 25 03:27:12 CEST 2014
On Fri, 24 Oct 2014 12:49:39 PM Matthias Weber wrote:
>
> I want always to see the "Process" of the green button in
dependence
> of the blue button at 100%.
Okay.
mwdat<-read.table(text=
"KOST Budget IST
1060 -2.18 0
1080 91037.71 91647.15
1100 955573.87 907938.98
1120 23326.8 0
1150 2521.57 0
1180 51302.03 48760.45
1200 2027.04 -1667.5
1210 2385.03 2386.06
1220 0 0
1250 528.87 0
1255 766.54 0
1260 12154.97 4861.41
Gesamtbudget 1141622.25 1054236.55",
header=TRUE)
par(las=1,mar=c(5,7,4,6))
plot(rep(100,13),1:13,main="IST against Budget",
xlab="IST/Budget (prozent)",ylab="KOST",
xlim=c(0,100),type="n",yaxt="n")
abline(h=1:13,lty=2,col="lightgray")
points(rep(100,13),1:13,pch=19,col="blue",cex=3)
mwdat$ISTpct<-100*mwdat$IST/mwdat$Budget
# fix divide by zero
mwdat$ISTpct[9]<-0
points(mwdat$ISTpct,1:13,pch=19,col="green",cex=3)
legend(105,10,c("Budget","IST"),pch=19,
col=c("blue","green"),bty="n",xpd=TRUE)
axis(2,at=1:13,labels=mwdat$KOST)
par(las=0,mar=c(5,4,4,2))
Jim
More information about the R-help
mailing list