Skip to content

Instantly share code, notes, and snippets.

@randyzwitch
Created August 29, 2014 19:11
Show Gist options
  • Save randyzwitch/bad86dfdc34d89b7eafb to your computer and use it in GitHub Desktop.
Save randyzwitch/bad86dfdc34d89b7eafb to your computer and use it in GitHub Desktop.
VennEuler Rectangle example
# Rectangles
eo = make_euler_object(labels, data, [EulerSpec(:rectangle), EulerSpec(:rectangle, [.5, .5, .4], [0, 0, 0]),
EulerSpec(:rectangle)],
sizesum=.3)
(minf,minx,ret) = optimize_iteratively(eo, random_state(eo), ftol=-1, xtol=0.0025, maxtime=5, pop=100)
println("phase 1: got $minf at $minx (returned $ret)")
(minf,minx,ret) = optimize(eo, minx, ftol=-1, xtol=0.001, maxtime=30, pop=100)
println("phase 2: got $minf at $minx (returned $ret)")
render("/home/rzwitch/Desktop/kd-rects.svg", eo, minx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment