I have a huge collection of data with date, client and its NFS usage. I'm using lattice R package for plotting, as adviced on superuser. Also, Stackoverflow helped me on converting the date string to an actual date object.
Now, my code is this:
require(lattice)
logfile <- read.table(file="nfsclients-2d.log")
names(logfile) <- c("Date","Client","Operations")
allcol <- c("blue","chocolate4","cornflowerblue","chartreuse4","brown3","darkorange3","darkorchid3","red","deeppink4","lightsalmon3","yellow","mistyrose4","seagreen3","green","violet","palegreen4","grey","slateblue3","tomato2","darkgoldenrod2","chartreuse","orange","black","yellowgreen","slategray3","navy","firebrick1","darkslategray3","bisque3","goldenrod4","antiquewhite2","coral","blue4","cyan4","darkred","orangered","purple4","royalblue4","salmon")
col=allcol[0:length(levels(logfile$Client))]
svg(filename="/tmp/nfsclients-2d.svg",width=14,height=7)
times <- as.POSIXct(strptime(levels(logfile$Date), format="%m/%d-%H:%M"))
logfile$Date <- times[logfile$Date]
xyplot(Operations~Date,group=Client,data=logfile,jitter.x=T,jitter.y=T,
aspect = 0.5, type = "l",
par.settings=list(superpose.line=list(col=col,lwd=3)),
xlab="Time", ylab="Operations", main="NFS Operations (last 2 days, only clients with >40 operations/sec)",
key=list( text=list(levels(logfile$Client)), space='right',
lines=list(col=col),columns=1,lwd=3,cex=0.75))
dev.off()
And the output file is this (stripped out the legend):
The X axis values are not very useful here: "tue" "tue" "wed" "wed". It seems that it only takes the first significative value as label. Some more labels (maybe 6 or 7) would be more useful also.
When plotting 2 weeks it's even worse. Only 2 values are displayed on the X axis: "2012" "2013". Not even repeated, only 2 values!
The data I'm plotting.