###############
## read data ##
###############
## read the original time-series: this one is needed for the dashed grey line, connecting all the dots
data <- read.csv("data.csv", sep=",")
data <- data[-15,] #remove data after 1935
data[,2] <- data[,2]/1000000 #devide data by 1000000 to get "millions" on the y-Axis
attach(data)
## read the time-series filled up with NA's: this one is needed for the solid lines, which are connecting only
# dots of cohering years
data.NA <- read.csv("data_NA.csv", sep=",")
data.NA <- data.NA[-(38:nrow(data.NA)),] #remove data after 1935
attach(data.NA)
tickets.NA <- tickets.NA/1000000 #devide data by 1000000 to get "millions" on the y-Axis
##############
## plotting ##
##############
##un-comment for pdf-output:
#pdf(file="test3.pdf", width=10, height=7)
par(cex=1.2)
## first, plot the grey line:
plot(tickets ~ year,
type="l",
lty=2,
col="grey50",
xlab="Jahr",
ylab="verkaufte Fahrkarten (Mio.)",
bty="l",
lwd=2)
## add the dots:
points(tickets.NA ~ year.NA,
pch=16,
col="blue")
## add the blue lines:
lines(tickets.NA ~ year.NA,
type="l",
lwd=2,
col="blue",
lend=3)
## add the legend:
legend(x="bottomright",
legend="keine zusammenhängenden Daten verfügbar",
lty=2,
col="grey50",
lwd=2,
bty="n")
##un-comment for pdf-output:
#dev.off()
The Graph was exported as PDF and imported in Inkscape for slight adjustments (e.g. Arrows) and then exported as SVG.