Code Monkey home page Code Monkey logo

pyvenn's Issues

cannot set dpi

Hi there,

I found that we cannot set 'dpi' as optional argument when calling venn() function.

Best regards,
Chao

matplotlib is currently using a non-GUI backend ERROR

Hello,
I'm trying to run the first code lines of the tutorial:

import matplotlib
matplotlib.use('Agg')
import venn
labels = venn.get_labels([
range(10),
range(5, 15)
], fill=['number', 'logic'])
print labels
fig, ax = venn.venn2(labels, names=['list 1', 'list 2'])
fig.show()

And I recibe this error:

/usr/local/lib/python2.7/dist-packages/matplotlib/figure.py:459: UserWarning: matplotlib is currently using a non-GUI backend, so cannot show the figure
"matplotlib is currently using a non-GUI backend, "

Do you know what is the problem and how to solve it?

Error when import ing using Python 2.7

I got this error:

File "/opt/mypython/local/lib/python2.7/site-packages/venn/_venn.py", line 101
def draw_venn(*, petal_labels, dataset_labels, hint_hidden, colors, figsize, fontsize, legend_loc, ax):
^
SyntaxError: invalid syntax

It seems there is a problem in the asterisk sign

module 'venn' has no attribute 'get_labels'

Hi,

I am trying to work with examples given in demo.py but I am getting an error that module 'venn' has no attribute 'get_labels'. I am using this package in windows 10 and jupyter notebook with python-3. I have attached the screenshot for the error I am getting.
Screenshot (66)

Can't import venn.py

Hi,

After cloning the git and trying to import venn.py, I get the following error message:
-bash: cd: source: No such file or directory (lsl) [tomasfly@access2 pyvenn]$ import threading Traceback (most recent call last): File "/apps/RH7U2/gnu/python/3.6.0/bin/import", line 11, in <module> load_entry_point('import==0.1.0', 'console_scripts', 'import')() File "/apps/RH7U2/gnu/python/3.6.0/lib/python3.6/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/apps/RH7U2/gnu/python/3.6.0/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2755, in load_entry_point return ep.load() File "/apps/RH7U2/gnu/python/3.6.0/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2408, in load return self.resolve() File "/apps/RH7U2/gnu/python/3.6.0/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2414, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/apps/RH7U2/gnu/python/3.6.0/lib/python3.6/site-packages/import.py", line 3 print('This is ultran00b's package - import') ^ SyntaxError: invalid syntax

any advice?

Thanks

Support for label combination 00...

I'm sure there is probably a way to do it using some combination of pyplot commands, but given this comes up quite a bit for venn diagrams, it would be nice if there was a clean way to specify labels and counts for the null-combination of classes. For example, the venn2 function should be able to cleanly handle input like...

labels = {"00": 2, "01": 5, "10": 5, "11": 10}
fig, ax = venn.venn2(labels, names=['list 1', 'list 2'])

and it should document the fact that their are 2 data points that aren't in list 1 or list 2 somewhere on the resultant figure. For now my easiest sollution to this is to just use pyplot.text and manually create the label for the category, but this is clunky. Another arguably less clunky sollution is to create the null category as a new label type and do something like...

labels = {"001": 2, "010": 5, "100": 5, "110": 10}
fig, ax = venn.venn3(labels, names=['list 1', 'list 2', "neither"])

I don't like this sollution though as it adds a false dimension to the data creating lots of positions where it seems like a count should exist but doesn't. ("111" for example)

The ideal sollution would both add the label for the 00* category to the legend and provide the ability to label the whitespace with the relevant count and name. This would probably require adding a keyword argument to the vennK functions to make them into something like.

def venn2(labels, names=['A', 'B'], null_name="None", **options):

EDIT: Played with it some more. Here is a way to add "null" labels to venn diagrams at the moment for anyone reading this. Would be nice if something like this became default behavior though or could easily be done through the use of an optional argument like "null_name" above

# names = some list of label names
# labels = dict mapping label combinations to counts as usual
fig, ax = venn2(labels, names)

# remake legend with null label
ax.plot([], color="white")
legend_null_label = "neither : 2"
ax.legend( [legend_null_label] + names, loc='center left', bbox_to_anchor=(1.0, 0.5), fancybox=True)

# optionally add the information somewhere on the figure
ax.text(0.95, 0.4, legend_null_label)

Is there

Is there any way to input a value for something that exists outside of the union of two or more sets? Something like the 25 in this example:

image

Thanks!

Can't get past the first line of the tutorial. TypeError: descriptor 'union' requires a 'set' object but received a 'range'

I'm trying the first line of the tutorial but get a typerror. See below:

import venn
import matplotlib
matplotlib.use('Agg')


labels = venn.get_labels([range(10),range(5, 15)], fill=['number', 'logic'])

TypeError                                 Traceback (most recent call last)
<ipython-input-151-0893ce4030bb> in <module>
      4 
      5 
----> 6 labels = venn.get_labels([range(10),range(5, 15)], fill=['number', 'logic'])

~\Anaconda3\lib\site-packages\venn\_backwards_compatibility.py in get_labels(data, fill)
     24     if "percent" in fill:
     25         fmt += "({percentage:.1f}%)"
---> 26     return generate_petal_labels(data, fmt)
     27 
     28 def vennx(labels, names, colors=OLD_COLORS, figsize=(9, 9), dpi=None, fontsize=14):

~\Anaconda3\lib\site-packages\venn\_venn.py in generate_petal_labels(datasets, fmt)
     58     datasets = list(datasets)
     59     n_sets = len(datasets)
---> 60     dataset_union = set.union(*datasets)
     61     universe_size = len(dataset_union)
     62     petal_labels = {}

TypeError: descriptor 'union' requires a 'set' object but received a 'range'

No license

This project has no license, this means that it cannot even be redistributed without the consent of the author.

You may want to pick an appropriate license (better if Free Software or Open Source) and put a LICENSE.md file with the terms in the repository.

Crowd Detection System

sir, can you please help me to build this system even I have code everything but I don't know to start from the beginning

ImportError: cannot import name 'Iterable' from 'collections'

I cloned the repo, cd'd in, typed python3 and hit enter. I tried importing venn, and the following happened:

>>> import venn

Traceback (most recent call last):

File "<stdin>", line 1, in <module>
File "/my/path/pyvenn/venn.py", line 3, in <module> from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.