konstantint / matplotlib-venn

Area-weighted venn-diagrams for Python/matplotlib
MIT License
495 stars 67 forks source link

bug intersection: venn3 #34

Closed carlotarp closed 6 years ago

carlotarp commented 6 years ago

Hi,

When comparing the results between venn3 and venn3_unweighted there is a intersection missed by venn3. The overlap of 41 elements between A and B.

image

image

I write down a print of the three sets. I hope you can solve this issue and thank you!

`A = {'638', '7', '53', '335', '44', '410', '483', '182', '330', '181', '30', '93', '96', '18', '157', '262', '25', '288', '396', '453', '615', '193', '378', '77', '376', '21', '23', '461', '12', '380', '552', '160', '5', '400', '339', '564', '250', '432', '45', '639', '11', '402', '538', '26', '276', '8', '123', '612', '510', '619', '518', '366', '247', '629', '464', '318', '59', '9', '333', '37', '425', '58', '345', '486', '117', '342', '519', '190', '4', '420', '176', '74', '329', '137', '313', '1', '6', '628', '354', '499', '537', '553', '643', '114', '609', '82', '156', '88', '349', '536', '69', '178', '60', '361', '431', '595', '322', '480', '70', '597', '632', '183', '589', '445', '419', '441', '547', '610', '20', '438', '78', '39', '71', '109', '55', '447', '202', '505', '326', '89', '95', '72', '498', '105', '601', '107', '523', '417', '170', '406', '319', '63', '152', '179', '363', '133', '115', '119', '586', '245', '67', '208', '189', '468', '206', '192', '204', '472', '15', '85', '511', '175', '433', '92', '127', '267', '484', '631', '33', '278', '503', '207', '494', '340', '646', '28', '533', '79', '393', '408', '86', '398', '297', '315', '168', '222', '649', '266', '141', '255', '244', '506', '91', '283', '604', '195', '97', '129', '385', '414', '528', '295', '495', '587', '309', '508', '301', '106', '434', '634', '359', '218', '577', '618', '375', '532', '17', '337', '648', '149', '50', '124', '323', '427', '98', '100', '132', '19', '108', '575', '260', '134', '351', '24', '338', '31', '362', '165', '161', '139', '565', '603', '41', '259', '475', '542', '372', '391', '321', '426', '620', '209', '299', '256', '14', '121', '34', '118', '27', '185', '491', '122', '306', '401', '314', '143', '405', '458', '48', '102', '264', '112', '186', '563', '135', '614', '130', '289', '443', '46', '99', '424', '525', '84', '104', '456', '635', '369', '64', '269', '423', '371', '279', '232', '22', '622', '128', '415', '0', '197', '373', '188', '568', '310', '75', '596', '184', '377', '61', '113', '561', '36', '38', '162', '562', '294', '225', '174', '513', '593', '221', '418', '501', '358', '625', '242', '3', '219', '567', '477', '101', '487', '379', '120', '56', '368', '304', '233', '627', '422', '520', '584', '572', '243', '524', '200', '303', '43', '300', '125', '146', '640', '257', '583', '148', '384', '470', '404', '51', '611', '389', '531', '298', '158', '645', '10', '138', '65', '49', '83', '599', '440', '40', '364', '650', '142', '554', '352', '386', '515', '2', '110', '626', '291', '442', '474', '435', '68', '144', '198', '80', '140', '249', '263', '292', '539', '167', '287', '652', '413', '594', '550', '52', '437', '66', '240', '482', '327', '571', '16', '613', '535', '305', '334', '116', '293', '336', '145', '653', '147', '636', '62', '365', '241', '136', '462', '514', '187', '191', '409', '578', '177', '560', '47', '155', '382', '90', '166', '395', '316'}

B={'548', '284', '268', '429', '227', '466', '476', '238', '181', '30', '452', '169', '490', '370', '25', '288', '213', '173', '378', '275', '21', '457', '12', '552', '54', '210', '455', '590', '478', '131', '302', '621', '518', '502', '9', '346', '37', '212', '488', '598', '345', '606', '486', '117', '331', '203', '451', '1', '628', '471', '499', '537', '641', '517', '235', '463', '88', '450', '248', '637', '254', '403', '592', '183', '328', '445', '448', '419', '252', '610', '214', '180', '71', '224', '607', '555', '29', '505', '430', '546', '416', '170', '63', '381', '363', '332', '551', '133', '324', '265', '473', '623', '388', '208', '189', '549', '206', '642', '192', '545', '472', '446', '267', '481', '33', '558', '311', '503', '407', '608', '494', '347', '408', '374', '469', '32', '222', '649', '507', '255', '521', '195', '97', '312', '129', '504', '414', '541', '348', '360', '290', '301', '106', '566', '556', '496', '634', '353', '359', '493', '218', '577', '387', '574', '111', '530', '274', '17', '246', '124', '534', '150', '98', '100', '582', '132', '605', '467', '344', '575', '633', '557', '159', '362', '509', '285', '565', '489', '41', '234', '34', '491', '164', '76', '42', '122', '226', '296', '654', '522', '439', '383', '485', '563', '479', '651', '540', '281', '525', '456', '516', '217', '369', '230', '163', '215', '423', '317', '428', '307', '616', '184', '421', '36', '38', '272', '617', '294', '588', '497', '625', '544', '394', '367', '584', '600', '277', '273', '581', '412', '298', '579', '49', '83', '599', '271', '655', '585', '229', '650', '142', '436', '569', '397', '515', '216', '320', '325', '103', '308', '286', '94', '529', '602', '154', '437', '66', '228', '343', '527', '327', '570', '196', '251', '57', '305', '116', '392', '147', '62', '241', '411', '409', '211', '236', '341', '270', '151', '444', '395', '526', '459', '543'}

C= {'548', '231', '335', '284', '268', '429', '227', '466', '591', '483', '476', '238', '181', '452', '169', '157', '490', '370', '288', '396', '213', '615', '193', '173', '378', '275', '376', '457', '559', '461', '380', '552', '160', '400', '455', '339', '564', '590', '250', '432', '478', '639', '402', '538', '276', '131', '302', '612', '621', '644', '510', '619', '502', '366', '629', '454', '464', '346', '333', '425', '460', '212', '488', '598', '345', '573', '606', '486', '342', '519', '190', '176', '331', '203', '451', '313', '628', '471', '499', '537', '553', '641', '517', '235', '463', '609', '156', '349', '450', '536', '178', '361', '431', '595', '248', '637', '280', '254', '403', '592', '183', '589', '448', '445', '419', '441', '547', '252', '610', '214', '180', '224', '447', '607', '555', '29', '202', '505', '326', '430', '546', '416', '601', '523', '417', '170', '152', '381', '363', '332', '551', '324', '265', '586', '473', '245', '623', '388', '189', '549', '468', '642', '192', '545', '204', '472', '511', '175', '433', '446', '267', '631', '481', '278', '558', '311', '503', '207', '407', '608', '494', '340', '347', '533', '408', '374', '469', '32', '168', '222', '649', '507', '255', '244', '521', '604', '195', '312', '385', '504', '528', '541', '295', '194', '495', '587', '348', '360', '290', '309', '508', '566', '556', '496', '434', '634', '353', '359', '172', '493', '218', '387', '574', '111', '618', '530', '274', '532', '337', '246', '124', '534', '427', '153', '150', '582', '605', '467', '344', '351', '633', '390', '338', '557', '159', '362', '165', '509', '285', '565', '489', '603', '259', '372', '391', '321', '620', '234', '209', '299', '185', '491', '164', '42', '356', '226', '296', '306', '401', '654', '405', '458', '522', '439', '383', '485', '264', '186', '563', '479', '651', '201', '289', '443', '261', '540', '281', '424', '525', '456', '449', '516', '217', '635', '369', '647', '230', '163', '215', '423', '317', '279', '371', '232', '428', '415', '197', '188', '307', '568', '310', '616', '596', '184', '239', '377', '561', '421', '272', '617', '562', '294', '225', '174', '588', '593', '221', '418', '501', '358', '497', '625', '219', '567', '477', '544', '487', '379', '394', '223', '627', '367', '422', '171', '584', '572', '243', '524', '200', '303', '512', '600', '300', '465', '640', '257', '277', '384', '273', '581', '611', '412', '531', '298', '158', '645', '579', '271', '440', '655', '229', '282', '585', '650', '554', '436', '352', '386', '569', '397', '515', '216', '291', '442', '320', '474', '435', '198', '249', '263', '325', '103', '308', '539', '286', '167', '652', '529', '413', '550', '154', '228', '343', '527', '327', '571', '570', '196', '251', '57', '613', '500', '535', '305', '334', '336', '392', '636', '399', '241', '462', '514', '187', '411', '191', '409', '578', '177', '211', '560', '236', '341', '270', '382', '166', '151', '444', '395', '316', '459', '543'}`

ENenova commented 6 years ago

the same problem :(

with some sets it's ok, with other does not work

konstantint commented 6 years ago

This is issue is basically a duplicate of #30. The problem is that there is no unique layout algorithm (because the venn diagram lacks one degree of freedom). The current one is focused on representing pairwise intersections faithfully, at the price of misrepresenting triple-intersections at times.

I will probably add a different layout algorithm eventually, but so far your best bet is to manually tune the sizes using venn3_unweighted (see the referenced issue for an example).

I am totally waiting for constructive suggestions regarding the alternative layout algorithm btw.

konstantint commented 6 years ago

Duplicate of #30