xn(x,y,r,a,b) = (r < 0.2) ? 0.05*x : (r < 0.4) ? b*x-0.32*y :\
            (r < 0.6) ? a*x-0.15*y : (r < 0.8) ? 0.4*x+0.28*y :\
            (r < 1.0) ? b*x+0.26*y : 0 
yn(x,y,r) = (r < 0.1) ? 0.6*y : (r < 0.2) ? -0.5*y + 1.0 : \
            (r < 0.4) ? 0.39*x+0.38*y+0.6 : (r < 0.6) ? 0.17*x+0.42*y+1.1 :\
            (r < 0.8) ? -0.25*x+0.45*y+1.0 : (r < 1) ? -0.35*x+0.31*y+0.7: 0 

set samples 15000
set term pngc enh font "Arial,10" size 480,480
set out "IFS_tree.png"
unset key
unset border
unset tics
set xrange [-1:1]
set yrange [0:2]
xp = 0.0
yp = 0.0
xc = 0.0
yc = 0.0

colors = "light-green forest-green dark-green \
          khaki dark-khaki yellow4 \
          #ffa07a dark-salmon dark-plum"  # "#ffa07a": lightsalmon

set multiplot layout 3,3
seed=rand(time(0))
do for [i = 0:8]{
a = 0.25 * ((i%3)+1)
b = 0.25 * ((i/3)+1)
plot '+' u (r=rand(0), xc=xn(xp,yp,r,a,b), yc=yn(xp,yp,r), xc) : \
           (xp=xc,yp=yc,yc) w dots lc rgb word(colors,i+1)
}
unset multiplot

! display "IFS_tree.png"