setterminalsvgsize650,350enhancedfont'Liberation Sans, Helvetica, Arial, sans-serif,10'setoutput'qtails-sans.svg'settitle'Q tails (sans-serif)'font"Liberation Sans Bold,16"filename='qtails.csv'rowi=1rowf=7# obtain sum(column(2)) from rows `rowi` to `rowf`setdatafileseparator'\t'statsfilenameu3every::rowi::rowfnooutprefix"A"# rowf should not be greater than length of filerowf=(rowf-rowi>A_records-1?A_records+rowi-1:rowf)angle(x)=x*360/A_sumpercentage(x)=x*100/A_sum# circumference dimensions for pie-chartcenterX=0centerY=0radius=1# label positionsyposmin=0.0yposmax=0.95*radiusxpos=1.5*radiusypos(i)=yposmax-i*(yposmax-yposmin)/(1.0*rowf-rowi)#-------------------------------------------------------------------# now we can configure the canvassetstylefillsolid1# filled pie-chartunsetkey# no automatic labelsunsettics# remove ticsunsetborder# remove borders; if some label is missing, comment to see what is happeningsetsizeratio-1# equal scale lengthsetxrange[-radius:2*radius]# [-1:2] leaves space for labelssetyrange[-radius:radius]# [-1:1]#-------------------------------------------------------------------pos=0# init anglecolour=0# init colour# 1st line: plot pie-chart# 2nd line: draw colored boxes at (xpos):(ypos)# 3rd line: place labels at (xpos+offset):(ypos)plotfilenameu(centerX):(centerY):(radius):(pos):(pos=pos+angle($3)):(colour=colour+1)every::rowi::rowfwcirclelcvar,\
for[i=0:rowf-rowi]'+'u(xpos):(ypos(i))wppt5ps4lci+1,\
for[i=0:rowf-rowi]filenameu(xpos):(ypos(i)):(sprintf('%.2f%% %s',percentage($3),stringcolumn(1)))every::i+rowi::i+rowiwlabelsleftoffset3
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse
↑3: $ style. Identifont. Retrieved on 2017-02-02. To get the numbers in the table, click Question 1 (serif or sans-serif?) or Question 2 (Q shape) and change the value. They appear under X possible fonts.
Captions
Add a one-line explanation of what this file represents