JuliaPlots / VennEuler.jl

Venn/Euler Diagrams for Julia
Other
11 stars 6 forks source link

Simple example #19

Open grero opened 5 years ago

grero commented 5 years ago

I realise this is not really actively developed anymore, but I was hoping there would be a simple example of how this package works. I was looking at the code in the test directory, and naively I thought that the following code should result in two non-overlapping circles.

using VennEuler
data = fill(false, 5,2)
data[[1,3,5],1] .= true
data[[2,4],2] .=true
labels = ["A","B"]
eo = make_euler_object(labels, data, EulerSpec())
(minf,minx,ret) = optimize(eo, random_state(eo,RNG), ftol=-1, xto      l=0.0025, maxtime=120, pop=1000)
render(joinpath("non_overlap.svg"), eo, minx)

However, I get the attached figure non_overlap

This probably means that there is something I'm not understanding.

HarlanH commented 5 years ago

Oy, it's been years since I've thought about this. But I suspect that the circles are too big, and so there's no way for the optimizer to move them so they don't overlap. Isn't there a scaling parameter somewhere? Try making them smaller... Do the examples from the test suite still run? (I have no idea at all whether the package runs under Julia 1.0!)

On Thu, Jan 10, 2019 at 1:30 AM Roger Herikstad notifications@github.com wrote:

I realise this is not really actively developed anymore, but I was hoping there would be a simple example of how this package works. I was looking at the code in the test directory, and naively I thought that the following code should result in two non-overlapping circles.

using VennEuler data = fill(false, 5,2) data[[1,3,5],1] .= true data[[2,4],2] .=true labels = ["A","B"] eo = make_euler_object(labels, data, EulerSpec()) (minf,minx,ret) = optimize(eo, random_state(eo,RNG), ftol=-1, xto l=0.0025, maxtime=120, pop=1000)render(joinpath("non_overlap.svg"), eo, minx)

However, I get the attached figure [image: non_overlap] https://user-images.githubusercontent.com/1245900/50950177-15104e80-14e4-11e9-9c48-b22367fda7bf.png

This probably means that there is something I'm not understanding.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HarlanH/VennEuler.jl/issues/19, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH--XsIynk9vKvOz7N8iH6fwk9hlS0Oks5vBt3wgaJpZM4Z43io .

grero commented 5 years ago

Thanks for getting back on this, I realise it was a shot in the dark : ) I was thinking of taking stab at bringing this up to date with 1.0 and perhaps hooking it up to Makie.jl for rendering. For now, I'm using this python package for making the above diagram matplotlib-venn which seems to work.

In [2]: import matplotlib_venn
In [3]: v = matplotlib_venn.venn2([set([1,3,5]), set([2,4])])

figure_1

Anyway, thanks again for taking the time to reply and I'll see what I can come up with.

HarlanH commented 5 years ago

Cool, glad to hear you've got an alternative. At some point I was thinking of rewriting it. The JuliaGeometry packages might make it possible to do exact computation of overlap now, although I suspect the optimization would still need to be stochastic... And yeah, should be much better rendering options now...

On Sun, Jan 13, 2019 at 9:33 PM Roger Herikstad notifications@github.com wrote:

Thanks for getting back on this, I realise it was a shot in the dark : ) I was thinking of taking stab at bringing this up to date with 1.0 and perhaps hooking it up to Makie.jl https://github.com/JuliaPlots/Makie.jl for rendering. For now, I'm using this python package for making the above diagram matplotlib-venn https://pypi.org/project/matplotlib-venn/ which seems to work.

In [2]: import matplotlib_venn In [3]: v = matplotlib_venn.venn2([set([1,3,5]), set([2,4])])

[image: figure_1] https://user-images.githubusercontent.com/1245900/51094424-b995d780-17e7-11e9-86bd-7647c7af5e11.png

Anyway, thanks again for taking the time to reply and I'll see what I can come up with.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HarlanH/VennEuler.jl/issues/19#issuecomment-453889678, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH--aYUeqcaOnvA9nD_UI9Y7mSzhgDjks5vC-x3gaJpZM4Z43io .

bjarthur commented 4 years ago

using sizesum=0.1 instead of the default 1.0 results in non-overlapping circles for the above example.

and, as of today, VennEuler.jl works with julia 0.7+ to include 1.0 and 1.2

bjarthur commented 4 years ago

specifically, eo = make_euler_object(labels, data, EulerSpec(), sizesum=0.1).

and for 0.7+ you need to be on master. so ]dev VennEuler. i'd like to see better docs in the README before tagging a release.