Reputation: 243
I just wrote some test code to make a three-way Venn Diagram. There's no errors, but there's also no output. I have logged in using the -XC parameter, and if i type "xclock", the picture of the clock pops up. When I run this script, nothing pops up at all (so it's not just an empty picture, there's no picture at all).
This is the code:
import numpy
import scipy
import matplotlib
from matplotlib_venn import venn3
import pylab as plt
set1 = set([1,2,3,4,5])
set2 = set([1,4,5,6])
set3 = set([1,4,6,8,6,3])
vd = venn3([set1,set2,set3],set_labels=("Set1","Set2","Set3"))
plt.title("Venn diagram")
plt.show()
I also read that I should change my back-ends; I tried doing this, but none of them seem to work, either for ones like PS/PDF; those ones I just get the same as above, no picture, no output. For other ones, e.g. Cairo, I get errors; and then I tried to re-install Cairo, and I got even more errors. So I would like to rule out basic problems because I get into installing things.
I'm just wondering, is the above code right, can anyone else get it to run that's on a similar system to me (using python 2.7 on Linux parker 3.2.0-90-generic #128-Ubuntu SMP Fri Aug 14 21:43:58 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux) in a virtual env; if you can get it to run; what is your back-end so then I know what back end I can focus on trying to set up?
Thanks
Upvotes: 3
Views: 1110
Reputation: 243
Thank you for the advice all. @JoeKington, this worked perfectly:
import numpy
import scipy
import matplotlib
from matplotlib_venn import venn3
import pylab as plt
set1 = set([1,2,3,4,5])
set2 = set([1,4,5,6])
set3 = set([1,4,6,8,6,3])
vd = venn3([set1,set2,set3],set_labels=("Set1","Set2","Set3"))
plt.title("Venn diagram")
plt.savefig("output",format="pdf")
Upvotes: 1