venn diagram_Venn Diagram Python软件包:Vennfig

venn diagram

目录 (Table of Contents)

  • Introduction

    介绍
  • Installation

    安装
  • Default Functions

    默认功能
  • Parameters

    参量
  • Examples

    例子
  • Conclusion

    结论

介绍 (Introduction)

In the last article, I showed how to draw basic Venn diagrams using matplotlib_venn.

在上一篇文章中 ,我展示了如何使用matplotlib_venn绘制基本的维恩图。

Each diagram requires 40 lines of code, so I created my first Python package, called Vennfig. You can draw a basic Venn diagram with one line of code, but flexible enough to meet your needs.

每个图需要40行代码,因此我创建了我的第一个Python包,称为Vennfig 。 您可以使用一行代码来绘制基本的维恩图,但是足够灵活以满足您的需求。

安装: (Installation:)

You can install it using pip:

您可以使用pip安装它:

pip install vennfig

On Jupyter:

在Jupyter上:

!pip install vennfig

You need to import vennfig.

您需要导入vennfig

import vennfig as v

默认功能 (Default Functions)

Image for post
All the vennfig functions.
所有的vennfig函数。

This table shows all the functions you can use.

下表显示了您可以使用的所有功能。

All the default functions show the two Venn diagrams, e.g A AND B, A NAND B, except subsets and mut_exclusive functions.

subsetsmut_exclusive函数外,所有默认函数均显示两个维恩图,例如A AND B,A mut_exclusive

They have the default color, size, font size, titles, etc.

它们具有默认的颜色,大小,字体大小,标题等。

参量 (Parameters)

Parameters allow you to modify your Venn diagrams.

参数允许您修改维恩图。

Example:

例:

import vennfig as v
v.a_b(subs=2, size=6, fill_color='#f5b705', bg_color='#f7edd0',
font_size=25, title_a='P', set_a='P', set_b='Q')
Image for post
Parameter names
参数名称

潜艇 (subs)

An identifier for the Venn diagrams you want to display.

您要显示的维恩图的标识符。

-1: default(both) -2: A -3: B

-1:默认(两者)-2:A -3:B

尺寸 (size)

Matplotlib figsize. The default is 15.

Matplotlib图figsize 。 默认值为15。

填色 (fill_color)

The default color is ‘skyblue’. You can use one of the characters {'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}, which are short-hands for blue, green, red, cyan, magenta, yellow, black, and white. You can also use a hex RGB or RGBA string (e.g., '#4287f5' or '#4287f580').

默认颜色为“天蓝色”。 您可以使用以下字符之一: {'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'} ,它们是蓝色,绿色的简写形式,红色,青色,洋红色,黄色,黑色和白色。 您也可以使用十六进制RGB或RGBA字符串(例如'#4287f5''#4287f580' )。

bg_color (bg_color)

The bg_color sets the matplotlib’s facecolor which is the background color.

bg_color设置matplotlib的facecolor,即背景色。

The default is 'white'.

默认为'white'

字体大小 (font_size)

The title font size. The default is 20.

标题字体大小。 默认值为20

title_a (title_a)

The title for the left-side Venn diagram.

左侧维恩图的标题。

title_b (title_b)

The title for the right-side Venn diagram.

右侧维恩图的标题。

set_a (set_a)

The left-side set label. The default is 'A'.

左侧设置标签。 默认值为'A'

set_b (set_b)

The right-side set label. The default is 'B'.

右侧设置标签。 默认值为'B'

字体大小 (text_size)

This sets the text font size. The default value is 15.

这将设置文本字体大小。 预设值为15。

Let’s see how easy it is to draw Venn diagrams.

让我们来看看绘制维恩图有多么容易。

例子 (Examples)

A,B维恩图 (A, B Venn Diagram)

A , B default Venn diagrams
A,B默认维恩图
A, B Venn diagram setting parameters.
A,B维恩图设置参数。

A和B,A与非B维恩图 (A AND B, A NAND B Venn Diagram)

A AND B, A NAND B default Venn diagrams.
A和B,A NAND B默认的维恩图。
A AND B default Venn diagrams setting parameters.
A AND B默认的维恩图设置参数。

真,假维恩图 (TRUE, FALSE Venn Diagram)

TRUE, FALSE default Venn diagrams.
TRUE,FALSE默认维恩图。
TRUE Venn diagram setting parameters.
真实的维恩图设置参数。

或,NOR维恩图 (OR, NOR Venn Diagram)

OR, NOR default Venn diagrams.
或,NOR默认维恩图。
NOR Venn diagram setting parameters.
NOR维恩图设置参数。

XOR,XNOR维恩图 (XOR, XNOR Venn Diagram)

XOR, XNOR default Venn diagrams.
XOR,XNOR默认的维恩图。
XOR Venn diagram setting parameters.
XOR Venn图设置参数。

非A,非B维恩图 (NOT A, NOT B Venn Diagram)

NOT A, NOT B default Venn diagrams.
不是A,不是B默认的维恩图。
NOT Q Venn diagram setting parameters.
NOT Q维恩图设置参数。

A NOT B,B NOT Venn图 (A NOT B, B NOT A Venn Diagram)

A NOT B, B NOT A default Venn diagrams.
A NOT B,B NOT A默认维恩图。
P NOT Q Venn diagram setting parameters.
P NOT Q维恩图设置参数。

隐含维恩图 (Implication Venn Diagram)

Implication default Venn diagrams.
隐含默认维恩图。
Q ⇒ P Venn diagram setting parameters.Q ⇒ P Venn diagram setting parameters.

互斥维恩图 (Mutually exclusive Venn Diagram)

Mutually exclusive default Venn diagram.
互斥的默认维恩图。
Mutually exclusive Venn diagram setting parameters.
互斥的维恩图设置参数。

补维恩图 (Complement Venn Diagram)

Complement default Venn diagrams.
补充默认的维恩图。
Complement Venn diagram setting parameters.
补充维恩图设置参数。

维恩图子集 (Subsets Venn Diagram)

Subsets default Venn diagram.
子集默认维恩图。
Subsets Venn diagram setting parameters.
子集Venn图设置参数。

终奌站 (Terminal)

You can use the terminal to create a Venn diagram.

您可以使用终端创建维恩图。

Image for post
Running vennfig on a terminal.
在终端上运行vennfig。

You can use pan to move the diagram as well.

您也可以使用pan来移动图表。

Image for post
The output from the terminal
终端的输出

结论 (Conclusion)

Let me know what you think. You can find the Github repo here.

让我知道你的想法。 您可以在这里找到Github仓库。

Please stay tuned for the next post.

请继续关注下一篇文章。

翻译自: https://towardsdatascience.com/introducing-basic-venn-diagram-python-package-vennfig-fa3f8e4dcb36

venn diagram

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/389111.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

应用程序的主入口点应用程序的主入口点应用程序的主入口点

/// <summary>/// 应用程序的主入口点。/// </summary>[STAThread]static void Main(string[] args){Stream stream Assembly.GetExecutingAssembly().GetManifestResourceStream("CapApp.TestApp.exe");byte[] bs new byte[stream.Length];stream.Rea…

创梦天地通过聆讯:上半年经营利润1.3亿 腾讯持股超20%

雷帝网 雷建平 11月23日报道时隔半年后&#xff0c;乐逗游戏母公司创梦天地终于通过上市聆讯&#xff0c;这意味着创梦天地很快将在港交所上市。创梦天地联合保荐人包括瑞信、招商证券国际、中金公司。当前&#xff0c;创梦天地运营的游戏包括《梦幻花园》、《快乐点点消》、《…

PyCharm之python书写规范--消去提示波浪线

强迫症患者面对PyCharm的波浪线是很难受的&#xff0c;针对如下代码去除PyCharm中的波浪线&#xff1a; # _*_coding:utf-8_*_ # /usr/bin/env python3 A_user "lin" A_password "lin123"for i in range(3): # 循环次数为3name input("请输入你的…

关于java static 关键字

当我们创建类时会指出哪个类的对象的外观与行为。 一般的流程是用new 创建这个类的对象&#xff0c;然后生成数据的存储空间&#xff0c;并使用相应的方法。 但以下两种情况不太适合这个流程&#xff1a; 只想用一个存储区域来保存一个特定的数据—–无论要创建多少个对象&a…

plotly django_使用Plotly为Django HTML页面进行漂亮的可视化

plotly djangoHello everyone! Recently I had to do some visualizations for my university project, I’ve done some googling and haven’t found any simple guides on how to put Plotly plots on an HTML page.大家好&#xff01; 最近&#xff0c;我不得不为我的大学项…

roce和iwarp_VIA、IB、RDMA、RoCE、iWARP、DPDK的发展与纠缠?

VIA(Virtual Interface Architecture): 这个只是一个标准&#xff0c;基本上不要了解太多。楼主的问题可以细分成2个层次考虑。一个是网络环境&#xff0c;二是具体的协议和实现。一、网络环境IB(InfiniBand): 是一种网络环境&#xff0c;做对比的是以太网, IB往往用于高性能集…

remoting

原文地址&#xff1a;http://blog.csdn.net/chengking/archive/2005/10/26/517349.aspx (一).说明 一个远程调用示例. 此示例实现功能: 客房端调用远程方法&#xff08;远程方法可以弹 出自定义信息&#xff09;&#xff0c;实现发送信息功能. 实现原理概是这样的…

handler 消息处理机制

关于handler消息处理机制&#xff0c;只要一提到&#xff0c;相信作为一个android工程师&#xff0c;脑海就会有这么一个流程 大家都滚瓜烂熟了&#xff0c;但别人问到几个问题&#xff0c;很多人还是栽到这个“烂”上面&#xff0c;比如&#xff1a; 一个线程是如何对应一个L…

es6简单介绍

let和const 原先声明变量的形式 var test 5; //全局变量 function a() {var cc3; //局部变量alert(test); } function b(){alert(test);}test 5;//全局变量 function a() {aa3; //全局变量alert(test); } 在es6之前&#xff0c;作用域只有全局作用域和函数作用域&#xff0…

软件工程方法学要素含义_日期时间数据的要素工程

软件工程方法学要素含义According to Wikipedia, feature engineering refers to the process of using domain knowledge to extract features from raw data via data mining techniques. These features can then be used to improve the performance of machine learning a…

洛谷P1605:迷宫(DFS)

题目背景 迷宫 【问题描述】 给定一个N*M方格的迷宫&#xff0c;迷宫里有T处障碍&#xff0c;障碍处不可通过。给定起点坐标和终点坐标&#xff0c;问: 每个方格最多经过1次&#xff0c;有多少种从起点坐标到终点坐标的方案。在迷宫中移动有上下左右四种方式&#xff0c;每次只…

vue图片压缩不失真_图片压缩会失真?快试试这几个无损压缩神器。

前端通常在做网页的时候 会出现图片加载慢的情况 在这里我通常会将图片进行压缩 但是通常情况下 观众会认为 图片压缩会出现失真的现象 在这里我会向大家推荐几款图片压缩的工具 基本上会实现无损压缩1.TinyPng地址&#xff1a;https://tinypng.comEnglish&#xff1f;不要慌&a…

remoteing2

此示例主要演示了net remoting,其中包含一个服务器程序Server.exe和一个客户端程序CAOClient.exe。客户端程序会通过http channel调用服务器端RemoteType.dll的对象和方法。服务器端的代码文件由下图所述&#xff1a;Server.cs源代码 :using System;using System.Runtime.Remot…

android 线程池

为什么用线程池 创建/销毁线程伴随着系统开销&#xff0c;过于频繁的创建/销毁线程&#xff0c;会很大程度上影响处理效率 例如&#xff1a; 记创建线程消耗时间T1&#xff0c;执行任务消耗时间T2&#xff0c;销毁线程消耗时间T3 如果T1T3>T2&#xff0c;那么是不是说开…

datatable转化泛型

public class ConvertHelper<T>where T:new() { /// <summary> /// 利用反射和泛型 /// </summary> /// <param name"dt"></param> /// <returns></returns> public static List<T> ConvertToList(DataTable dt) { …

【跃迁之路】【651天】程序员高效学习方法论探索系列(实验阶段408-2018.11.24)...

(收集箱&#xff08;每日一记&#xff0c;每周六整理&#xff09;)专栏 实验说明 从2017.10.6起&#xff0c;开启这个系列&#xff0c;目标只有一个&#xff1a;探索新的学习方法&#xff0c;实现跃迁式成长实验期2年&#xff08;2017.10.06 - 2019.10.06&#xff09;我将以自己…

更换mysql_Docker搭建MySQL主从复制

Docker搭建MySQL主从复制 主从服务器上分别安装Docker 1.1 Docker 要求 CentOS 系统的内核版本高于 3.10 [rootlocalhost ~]# uname -r 3.10.0-693.el7.x86_641.2 确保 yum 包更新到最新。 [rootlocalhost ~]# sudo yum update Loaded plugins: fastestmirror, langpacks Loadi…

dll文件的c++制作dll文件的c++制作

dll文件的c制作1、首先用vs2005建立一个c的dll动态链接库文件&#xff0c;这时&#xff0c;// DllTest.cpp : 定义 DLL 应用程序的入口点。//#include "stdafx.h"//#include "DllTest.h"#ifdef _MANAGED#pragma managed(push, off)#endifBOOL APIENTRY Dll…

理解ConstraintLayout 对性能的好处

自从在17年GoogleI/O大会宣布了Constraintlayout,我们持续提升了布局的稳定性和布局编辑的支持。我们还为ConstraintLayout添加了一些新特性支持创建不同类型的布局&#xff0c;添加这些新特性&#xff0c;可以明显的提升性能&#xff0c;在这里&#xff0c;我门将讨论Contrain…

数据湖 data lake_在Data Lake中高效更新TB级数据的模式

数据湖 data lakeGOAL: This post discusses SQL “UPDATE” statement equivalent for a data lake (object) storage using Apache Spark execution engine. To further clarify consider this, when you need to perform conditional updates to a massive table in a relat…