Saturday, February 18, 2012

Visualising COE (Certificate of Entitlement)

I managed to web scrap all the COE (Certificate of Entitlement) from LTA site at http://www.lta.gov.sg/content/lta/en/corporate/corp_info/index_corp_press.html.
With gnuplot's multiplot feature, I am able to combine the COE quota premium ($) and quota bidding in a single plot. Also, I am able to put Categories A, B and E together in an animated GIF file. Here is the animation:









It is clear that there are far less COE quota given for the past 2 years and therefore the COE price keeps going up. Anyway my objective is on visualisation rather than trying to analyse COE trend. Here is my gnuplot code:
set terminal png size 800,480 font "Arial,10"
set xdata time
set timefmt "%Y-%m-%d"
set format y '%6.0f'
set xrange [:"2012-08-01"]
set xtic offset 4


# -- 1st plot
set output 'coe-a.png'
set multiplot
set title "Singapore C.O.E. (Category A <1600cc), last update 2012-07-19"
set ylabel "Quota Premium ($)"
set size 1,0.65
set origin 0,0.35
set bmargin 0
unset key
set format x ''
set grid
set yrange [0:100000]
set ytics 10000
plot 'coe.txt' using 1:3 with lines

unset title
set key right box
set bmargin
set size 1,0.3
set origin 0,0
set tmargin 0
set ylabel 'Quota'
set format x '%Y'
set yrange [0:6000]
set ytics 1000
plot \
'coe.txt' using 1:4 with filledcurves x1 linetype 1 title 'Total Bids', \
'coe.txt' using 1:2 with filledcurves x1 linetype 2 title 'Quota', \
'coe.txt' using 1:4 with lines linetype -1 notitle, \
'coe.txt' using 1:2 with lines linetype -1 notitle


reset 

unset multiplot
set output 'coe-b.png'
set xdata time
set timefmt "%Y-%m-%d"
set format y '%6.0f'
set xrange [:"2012-08-01"]
set xtic offset 4

# -- 2nd plot
set multiplot
set title "Singapore C.O.E. (Category B >1600cc), last update 2012-07-19"
set ylabel "Quota Premium ($)"
set size 1,0.65
set origin 0,0.35
set bmargin 0
unset key
set format x ''
set grid
set yrange [0:100000]
set ytics 10000
plot 'coe.txt' using 1:8 with lines


unset title
set key right box
set bmargin
set size 1,0.3
set origin 0,0
set tmargin 0
set ylabel 'Quota'
set format x '%Y'
set yrange [0:6000]
set ytics 1000
plot \
'coe.txt' using 1:9 with filledcurves x1 linetype 1 title 'Total Bids', \
'coe.txt' using 1:7 with filledcurves x1 linetype 2 title 'Quota', \
'coe.txt' using 1:9 with lines linetype -1 notitle, \
'coe.txt' using 1:7 with lines linetype -1 notitle


reset

unset multiplot
set xdata time
set output 'coe-e.png'
set timefmt "%Y-%m-%d"
set format y '%6.0f'
set xrange [:"2012-08-01"]
set xtic offset 4

# -- 3rd plot
set multiplot
set title "Singapore C.O.E. (Category E -  Open), last update 2012-07-19"
set ylabel "Quota Premium ($)"
set size 1,0.65
set origin 0,0.35
set bmargin 0
unset key
set format x ''
set grid
set yrange [0:100000]
set ytics 10000
plot 'coe.txt' using 1:23 with lines


unset title
set key right box
set bmargin
set size 1,0.3
set origin 0,0
set tmargin 0
set ylabel 'Quota'
set format x '%Y'
set yrange [0:6000]
set ytics 1000
plot \
'coe.txt' using 1:24 with filledcurves x1 linetype 1 title 'Total Bids', \
'coe.txt' using 1:22 with filledcurves x1 linetype 2 title 'Quota', \
'coe.txt' using 1:24 with lines linetype -1 notitle, \
'coe.txt' using 1:22 with lines linetype -1 notitle
Interested in the data ? It is in the source. :-)
FYI, I will update the graph regularly to reflect the COE trend

Labels:

0 Comments:

Post a Comment

<< Home