Skip to content

July 2014

Plotting with the Highcharts.js API

  • by

[code language=”html”] <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/modules/exporting.js"></script> <div id="container" style="min-width: 310px; max-width: 800px; height: 1200px; margin: 0 auto"></div> $(function () { $(‘#container’).highcharts({ chart: { type: ‘bar’ }, title: { text: ” }, subtitle: { text: ‘Source:… 

Plotting with the plot.ly API

  • by

[code language=”javascript”] var data = [{&quot;name&quot;:&quot;Gaseous fuel&quot;,&quot;type&quot;:&quot;scatter&quot;,&quot;fill&quot;:&quot;tonexty&quot;,&quot;mode&quot;:&quot;lines&quot;,&quot;xsrc&quot;:&quot;isnerd:1:0I4LU2RD2QVQRQS0Q35GU4N1D97CL8EI&quot;,&quot;ysrc&quot;:&quot;isnerd:1:MG6030IZ7H4OZ5WH8Z0BZNN9E4MEJMIT&quot;,&quot;uid&quot;:&quot;cbaea7&quot;,&quot;line&quot;:{&quot;shape&quot;:&quot;linear&quot;},&quot;marker&quot;:{&quot;line&quot;:{}},&quot;textfont&quot;:{},&quot;error_y&quot;:{&quot;visible&quot;:true,&quot;type&quot;:&quot;percent&quot;,&quot;array&quot;:[0,3.667,11.001,11.001,22.002,282.359,311.695,487.711,751.735,997.424,924.084,1085.432,1206.443,1169.773,1360.457,1734.491,2295.542,2482.559,2742.916,3032.609,2489.893,2885.929,4363.73,5247.477,6175.228,7205.655,10318.938,12786.829,15218.05,18533.018,21114.586,23582.477,27278.813,27018.456,29024.305,39082.886,39779.616,46061.187,47634.33,42350.183,43908.658,43604.297,47172.288,50028.881,49625.511,50479.922,49482.498,52738.794,57366.548,79067.854,98458.95],&quot;traceref&quot;:&quot;0&quot;,&quot;symmetric&quot;:true},&quot;error_x&quot;:{},&quot;connectgaps&quot;:false,&quot;autobinx&quot;:true,&quot;autobiny&quot;:true,&quot;colorbar&quot;:{},&quot;xbins&quot;:{&quot;start&quot;:1949.5,&quot;end&quot;:2019.5,&quot;size&quot;:10},&quot;ybins&quot;:{&quot;start&quot;:-40000,&quot;end&quot;:120000,&quot;size&quot;:20000},&quot;zmin&quot;:0,&quot;zmax&quot;:20,&quot;contours&quot;:{&quot;start&quot;:2,&quot;size&quot;:2,&quot;end&quot;:18.02}},{&quot;name&quot;:&quot;Liquid fuel&quot;,&quot;type&quot;:&quot;scatter&quot;,&quot;fill&quot;:&quot;tonexty&quot;,&quot;mode&quot;:&quot;lines&quot;,&quot;xsrc&quot;:&quot;isnerd:1:0I4LU2RD2QVQRQS0Q35GU4N1D97CL8EI&quot;,&quot;ysrc&quot;:&quot;isnerd:1:QRC9D8VKPOBSQ7TRFE4ZYM9KO7VJZQP5&quot;,&quot;uid&quot;:&quot;092b82&quot;,&quot;line&quot;:{},&quot;marker&quot;:{&quot;line&quot;:{}},&quot;textfont&quot;:{},&quot;error_y&quot;:{&quot;visible&quot;:true,&quot;array&quot;:[19460.769,21327.272,24906.264,27128.466,28144.225,30839.47,35705.579,32724.308,42284.177,45386.459,49372.488,55489.044,58925.023,61799.951,60677.849,61887.959,63490.438,68613.237,75378.852,82731.187,83244.567,89786.495,94483.922,99251.022,106192.653,116856.289,121957.086,127776.615,133724.489,150838.378,158297.056,166558.807,188208.775,187031.668,199118.1,216459.343,243360.455,244401.883,263107.25,285483.284,303752.278,298068.428,284834.225,293851.378,296858.318,300011.938,316902.14,323656.754,419020.756,472771.642,465294.629],&quot;type&quot;:&quot;percent&quot;,&quot;traceref&quot;:&quot;1&quot;},&quot;error_x&quot;:{},&quot;autobinx&quot;:true,&quot;autobiny&quot;:true,&quot;colorbar&quot;:{},&quot;xbins&quot;:{&quot;start&quot;:1919.5,&quot;end&quot;:2039.5,&quot;size&quot;:20},&quot;ybins&quot;:{&quot;start&quot;:-100000,&quot;end&quot;:600000,&quot;size&quot;:100000},&quot;zmin&quot;:0,&quot;zmax&quot;:20,&quot;contours&quot;:{&quot;start&quot;:2,&quot;size&quot;:2,&quot;end&quot;:18.02}},{&quot;name&quot;:&quot;Solid fuel&quot;,&quot;type&quot;:&quot;scatter&quot;,&quot;fill&quot;:&quot;tonexty&quot;,&quot;mode&quot;:&quot;lines&quot;,&quot;xsrc&quot;:&quot;isnerd:1:0I4LU2RD2QVQRQS0Q35GU4N1D97CL8EI&quot;,&quot;ysrc&quot;:&quot;isnerd:1:HIWFG08N46UFGKAQD6T2PUCS3YVCK31J&quot;,&quot;uid&quot;:&quot;665793&quot;,&quot;line&quot;:{},&quot;marker&quot;:{&quot;line&quot;:{}},&quot;textfont&quot;:{},&quot;error_y&quot;:{&quot;visible&quot;:true,&quot;array&quot;:[97208.503,104956.874,114227.05,122144.103,117167.984,128818.043,129404.763,131740.642,136973.451,136463.738,136669.09,140449.767,148641.845,152440.857,161102.311,178465.556,186855.652,232986.512,228175.408,234849.348,252854.318,268618.751,284533.531,310858.924,315064.973,343975.601,370466.009,395925.99,429585.383,459625.447,476853.013,514436.096,539639.387,569712.454,604306.932,630294.961,677965.961,710004.54,715464.703,768665.539,788507.676,806574.985,834689.874,874660.174,935308.687,986632.019,1056349.023,1147807.67,1240524.098,1326284.227,1338473.335],&quot;type&quot;:&quot;percent&quot;,&quot;traceref&quot;:&quot;2&quot;},&quot;error_x&quot;:{},&quot;autobinx&quot;:true,&quot;autobiny&quot;:true,&quot;colorbar&quot;:{},&quot;xbins&quot;:{&quot;start&quot;:1919.5,&quot;end&quot;:2039.5,&quot;size&quot;:20},&quot;ybins&quot;:{&quot;start&quot;:-500000,&quot;end&quot;:2000000,&quot;size&quot;:500000},&quot;zmin&quot;:0,&quot;zmax&quot;:20,&quot;contours&quot;:{&quot;start&quot;:2,&quot;size&quot;:2,&quot;end&quot;:18.02}}]; var layout = {&quot;title&quot;:&quot;CO2 emissions from consumption of fuel types (with error)&quot;,&quot;xaxis&quot;:{&quot;range&quot;:[1957.2222222222222,2012.7777777777778],&quot;type&quot;:&quot;linear&quot;,&quot;showline&quot;:false,&quot;mirror&quot;:false,&quot;linecolor&quot;:&quot;#444&quot;,&quot;linewidth&quot;:1,&quot;tick0&quot;:0,&quot;dtick&quot;:10,&quot;ticks&quot;:&quot;&quot;,&quot;ticklen&quot;:5,&quot;tickwidth&quot;:1,&quot;tickcolor&quot;:&quot;#444&quot;,&quot;nticks&quot;:0,&quot;showticklabels&quot;:true,&quot;tickangle&quot;:&quot;auto&quot;,&quot;exponentformat&quot;:&quot;SI&quot;,&quot;showexponent&quot;:&quot;all&quot;,&quot;showgrid&quot;:true,&quot;gridcolor&quot;:&quot;#eee&quot;,&quot;gridwidth&quot;:1,&quot;autorange&quot;:true,&quot;rangemode&quot;:&quot;normal&quot;,&quot;autotick&quot;:true,&quot;zeroline&quot;:true,&quot;zerolinecolor&quot;:&quot;#444&quot;,&quot;zerolinewidth&quot;:1,&quot;titlefont&quot;:{&quot;family&quot;:&quot;Droid Sans, sans-serif&quot;,&quot;size&quot;:0,&quot;color&quot;:&quot;&quot;},&quot;tickfont&quot;:{&quot;family&quot;:&quot;Droid Sans, sans-serif&quot;,&quot;size&quot;:0,&quot;color&quot;:&quot;&quot;},&quot;overlaying&quot;:false,&quot;domain&quot;:[0,1],&quot;position&quot;:0,&quot;anchor&quot;:&quot;y&quot;,&quot;title&quot;:&quot;Year&quot;},&quot;yaxis&quot;:{&quot;range&quot;:[-81795.59269444444,1554116.2611944443],&quot;type&quot;:&quot;linear&quot;,&quot;showline&quot;:false,&quot;mirror&quot;:false,&quot;linecolor&quot;:&quot;#444&quot;,&quot;linewidth&quot;:1,&quot;tick0&quot;:0,&quot;dtick&quot;:500000,&quot;ticks&quot;:&quot;&quot;,&quot;ticklen&quot;:5,&quot;tickwidth&quot;:1,&quot;tickcolor&quot;:&quot;#444&quot;,&quot;nticks&quot;:0,&quot;showticklabels&quot;:true,&quot;tickangle&quot;:&quot;auto&quot;,&quot;exponentformat&quot;:&quot;SI&quot;,&quot;showexponent&quot;:&quot;all&quot;,&quot;showgrid&quot;:true,&quot;gridcolor&quot;:&quot;#eee&quot;,&quot;gridwidth&quot;:1,&quot;autorange&quot;:true,&quot;rangemode&quot;:&quot;normal&quot;,&quot;autotick&quot;:true,&quot;zeroline&quot;:true,&quot;zerolinecolor&quot;:&quot;#444&quot;,&quot;zerolinewidth&quot;:1,&quot;titlefont&quot;:{&quot;family&quot;:&quot;Droid Sans, sans-serif&quot;,&quot;size&quot;:0,&quot;color&quot;:&quot;&quot;},&quot;tickfont&quot;:{&quot;family&quot;:&quot;Droid Sans, sans-serif&quot;,&quot;size&quot;:0,&quot;color&quot;:&quot;&quot;},&quot;overlaying&quot;:false,&quot;domain&quot;:[0,1],&quot;position&quot;:0,&quot;anchor&quot;:&quot;x&quot;,&quot;title&quot;:&quot;CO2 emissions in kilo-tonnes&quot;},&quot;legend&quot;:{&quot;bgcolor&quot;:&quot;#fff&quot;,&quot;bordercolor&quot;:&quot;#444&quot;,&quot;borderwidth&quot;:0,&quot;font&quot;:{&quot;family&quot;:&quot;Droid Sans, sans-serif&quot;,&quot;size&quot;:0,&quot;color&quot;:&quot;&quot;},&quot;traceorder&quot;:&quot;reversed&quot;,&quot;xanchor&quot;:&quot;left&quot;,&quot;yanchor&quot;:&quot;top&quot;,&quot;x&quot;:1.02,&quot;y&quot;:1},&quot;width&quot;:1214,&quot;height&quot;:404,&quot;autosize&quot;:true,&quot;margin&quot;:{&quot;l&quot;:80,&quot;r&quot;:80,&quot;t&quot;:100,&quot;b&quot;:80,&quot;pad&quot;:2,&quot;autoexpand&quot;:true},&quot;paper_bgcolor&quot;:&quot;#fff&quot;,&quot;plot_bgcolor&quot;:&quot;rgb(217, 217,… 

What is ‘The Last Why’?

  • by

I’m changing this blog’s name from Is Nerd because I haven’t felt like a nerd for a while and the blog’s contents have reflected that, too. At the same time, I’m not going to split up… 

Science Quiz – July 21, 2014

  • by

Every week, I create a science quiz for The Hindu newspaper’s In School product. It consists of 10 questions and only developments from the week preceding its day of publication (Monday). The answers are at… 

A thicker crust on Vesta questions how it was baked

  • by

Billing its mission as a journey to the beginning of the Solar System, the NASA Dawn probe has revealed more information about the asteroid Vesta that has scientists both eager and cautious about what they… 

Hinterland

  • by

I hate travelling. But don’t confuse that with going to new places and meeting new people. I don’t mind that. What I dislike is catching a train or a flight and mingling with other people… 

Plagiarism is plagiarism

  • by

In a Nature article, Praveen Chaddah argues that textual plagiarism entails that the offending paper only carry a correction and not be retracted because that makes the useful ideas and results in the paper unavailable. On the face of… 

Billow clouds, shocked streams & shedding eddies

  • by

I flew from Bangalore to Delhi on Tuesday. The flight was early in the day, at 6, and so I had the wonderful opportunity to watch a sunrise from above a sea of clouds. One very beautiful… 

Motion charts in R

  • by

Formatting a motion chart in Google Visualization is as hellish as it’s surprising how simple R makes it. One more reason to learn this underrated language. To create this motion chart, I downloaded the data… 

Science Quiz – July 7, 2014

  • by

Every week, I create a science quiz for The Hindu newspaper’s In School product. It consists of 10 questions and only developments from the week preceding its day of publication (Monday). The answers are at the end. The _______ region of…