如何在python venn中将维恩图保存为PNG

问题描述 投票:0回答:1

https://github.com/LankyCyril/pyvenn/blob/master/pyvenn-demo.ipynb 在这个库中,我想知道如何将维恩图另存为PNG

我知道如何在 matplotlib_venn 中将维恩图保存为 PNG 但是,我不知道在Venn 我想将维恩图另存为 PNG

请帮助我...

python png visualization venn
1个回答
0
投票
import matplotlib.pyplot as plt
from venn import venn
%matplotlib inline

musicians = {
    "Members of The Beatles": {"Paul McCartney", "John Lennon", "George Harrison", "Ringo Starr"},
    "Guitarists": {"John Lennon", "George Harrison", "Jimi Hendrix", "Eric Clapton", "Carlos Santana"},
    "Played at Woodstock": {"Jimi Hendrix", "Carlos Santana", "Keith Moon"}
}
# Save the figure
venn(musicians).get_figure().savefig("output.png")
© www.soinside.com 2019 - 2024. All rights reserved.