Draw Venn Diagram of any number of inputs
Version 1.0.0 (1.85 KB) by
Sambit Supriya Dash
It's a function to draw the venn diagram of any number of input values with legends, sizes and customized colors.
Download the function and keep the function in the same folder/directory as MAIN script has been kept.
For example, paste the following code as the MAIN script:
close all; clear all; clc; % CLEANING
% Define the number of sets
numSets = 5;
% Define the values for each set
sets = {[1, 2, 3], [2, 3, 4], [1, 4, 5], [3, 5, 6, 7], [1,2,4,5]};
% Define the labels for each set
setLabels = {'Set 1', 'Set 2', 'Set 3', 'Set 4', 'Set 5'};
% Define the sizes of the circles for each set
circleSizes = [100, 80, 60, 40, 120];
% Define the colors for each set
colors = {[1 0 0], [0 1 0], [0 0 1], [1 1 0], [1 0 1]}; % edittable colours i.e. JET, SUMMER, etc...
DrawVennDiag(numSets,sets,setLabels,circleSizes,colors) % Execution of the function
Cite As
Sambit Supriya Dash (2026). Draw Venn Diagram of any number of inputs (https://www.mathworks.com/matlabcentral/fileexchange/126245-draw-venn-diagram-of-any-number-of-inputs), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2022b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Acknowledgements
Inspired: Draw Venn Diagram of any number of inputs (version 2)
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
