Skip to content

Instantly share code, notes, and snippets.

@astronasutarou
Created February 7, 2013 06:21
Show Gist options
  • Save astronasutarou/4728943 to your computer and use it in GitHub Desktop.
Save astronasutarou/4728943 to your computer and use it in GitHub Desktop.
ボロノイ図を陰線処理で作成する方法 on gnuplot
#!/usr/bin/gnuplot
## define cone function
cone(x,y,cx,cy) = 1 - sqrt((x-cx)**2+(y-cy)**2)
## set hidden line removal
set hidden3d
## set view
set view 0,0
set view equal xy
set border 256+521+1024+2048
set ztics format ""
## define line style
set linetype 1 lc rgb hsv( 0,216,255);
set linetype 3 lc rgb hsv( 72,216,255);
set linetype 5 lc rgb hsv(144,216,255);
set linetype 7 lc rgb hsv(216,216,255);
set linetype 9 lc rgb hsv(288,216,255);
## remove legend
unset key
## set mesh scale
set isosample 100
eval sprintf("splot cone(x,y, %.1f, %.1f) w l", \
20*rand(0)-10,20*rand(0)-10);
LOOP=0;
while(LOOP<4) {
eval sprintf("replot cone(x,y, %.1f, %.1f) w l", \
20*rand(0)-10,20*rand(0)-10,LOOP);
LOOP=LOOP+1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment