martes, 13 de marzo de 2012

SED + GNUPLOT






Codigo de Bash

#!/bin/bash -f

sed 's/\.1.\{1,\}/\.1/g' < datos.browser| sed 's/\.2.\{1,\}/\.2/g'|
sed 's/\.3.\{1,\}/\.3/g'| sed 's/\.4.\{1,\}/\.4/g'|
sed 's/\.5.\{1,\}/\.5/g'| sed 's/\.6.\{1,\}/\.6/g'|
sed 's/\.7.\{1,\}/\.7/g'| sed 's/\.8.\{1,\}/\.8/g'|
sed 's/\.9.\{1,\}/\.9/g'| sed 's/\.0.\{1,\}/\.0/g' > datos-p.browser

cat datos-p.browser chartok.plot > chartok2.plot

gnuplot chartok2.plot

echo "Listo"





Codigo de GNUPLOT

reset

IE=35.8
Chrome=30.8
Firefox=20.5
Safari=6.5
Opera=4.3
NetScape=3.6

set term svg
set output 'chart.svg'

total=IE+Chrome+Firefox+Safari+Opera+NetScape

IEn=IE/total
Chromen=Chrome/total
Firefoxn=Firefox/total
Safarin=Safari/total
Operan=Opera/total
NetScapen=NetScape/total

b=0.4
s=0.2
B=0.5

set view 30, 20
set parametric
unset border
unset tics
unset key
set ticslevel 0
unset colorbox
set urange [0:1]
set vrange [0:1]
set xrange [-2:2]
set yrange [-2:2]
set zrange [0:3]
set multiplot

# First, we draw the 'box' around the plotting volume
set palette model RGB functions 0.9, 0.9,0.95
splot -2+4*u, -2+4*v, 0 w pm3d

set palette model RGB functions 0.8, 0.8, 0.85

set urange [IEn:1]
splot cos(u*2*pi)*v, sin(u*2*pi)*v, 0 w pm3d

set urange [0:IEn]
splot cos(IEn*pi)*b+cos(u*2*pi)*v, sin(IEn*pi)*b+sin(u*2*pi)*v, 0 w pm3d

set palette model RGB functions 1, 0, 0
set urange [0:IEn]
splot cos(IEn*pi)*b+cos(u*2*pi)*v, sin(IEn*pi)*b+sin(u*2*pi)*v, s w pm3d

set palette model RGB functions 0, 0.5, 0
set urange [IEn:IEn+Chromen]
splot cos(u*2*pi)*v, sin(u*2*pi)*v, s w pm3d

set palette model RGB functions 0, 0, 0.8
set urange [IEn+Chromen:IEn+Chromen+Firefoxn]
splot cos(u*2*pi)*v, sin(u*2*pi)*v, s w pm3d

set palette model RGB functions 0.8, 0, 0.8
set urange [IEn+Chromen+Firefoxn:IEn+Chromen+Firefoxn+Safarin]
splot cos(u*2*pi)*v, sin(u*2*pi)*v, s w pm3d

set palette model RGB functions 0.8, 0.8, 0
set urange [IEn+Chromen+Firefoxn+Safarin:IEn+Chromen+Firefoxn+Safarin+Operan]
splot cos(u*2*pi)*v, sin(u*2*pi)*v, s w pm3d

set palette model RGB functions 0, 0.8, 0.8
set urange [IEn+Chromen+Firefoxn+Safarin+Operan:IEn+Chromen+Firefoxn+Safarin+Operan+NetScapen]
set label 1 'IE' at cos(IEn*pi)*B+cos(IEn*pi), sin(IEn*pi)*B+sin(IEn*pi)
D = 2*IEn+Chromen
set label 2 'Chrome' at cos(D*pi)*B+cos(D*pi), sin(D*pi)*B+sin(D*pi)
D=D+Chromen+Firefoxn
set label 3 'Firefox' at cos(D*pi)*B+cos(D*pi), sin(D*pi)*B+sin(D*pi)
D=D+Firefoxn+Safarin
set label 4 'Safari' at cos(D*pi)*B+cos(D*pi), sin(D*pi)*B+sin(D*pi)
D=D+Safarin+Operan
set label 5 'Opera' at cos(D*pi)*B+cos(D*pi), sin(D*pi)*B+sin(D*pi)
D=D+Operan+NetScapen
set label 6 'NetScape' at cos(D*pi)*B+cos(D*pi), sin(D*pi)*B+sin(D*pi)
splot cos(u*2*pi)*v, sin(u*2*pi)*v, s w pm3d
unset multiplot








No hay comentarios:

Publicar un comentario