-
Notifications
You must be signed in to change notification settings - Fork 60
/
plot_generated.py
43 lines (30 loc) · 1.09 KB
/
plot_generated.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
============================
Plotting with generated data
============================
This example illustrates basic plotting functionality using generated data.
"""
from matplotlib import pyplot as plt
from upsetplot import generate_counts, plot
example = generate_counts()
print(example)
##########################################################################
plot(example)
plt.suptitle("Ordered by degree")
plt.show()
##########################################################################
plot(example, sort_by="cardinality")
plt.suptitle("Ordered by cardinality")
plt.show()
##########################################################################
plot(example, show_counts="{:d}")
plt.suptitle("With counts shown")
plt.show()
##########################################################################
plot(example, show_counts="%d", show_percentages=True)
plt.suptitle("With counts and % shown")
plt.show()
##########################################################################
plot(example, show_percentages="{:.2%}")
plt.suptitle("With fraction shown in custom format")
plt.show()