-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathplot_generated.py
More file actions
52 lines (36 loc) · 1.36 KB
/
Copy pathplot_generated.py
File metadata and controls
52 lines (36 loc) · 1.36 KB
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
44
45
46
47
48
49
50
51
52
"""
===================================
Basic: Examples with generated data
===================================
This example illustrates basic plotting functionality using generated data.
"""
import matplotlib
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="{:,}")
plt.suptitle("With counts shown, using a thousands separator")
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()
##########################################################################
matplotlib.rcParams["font.size"] = 6
plot(example, show_percentages="{:.2%}")
plt.suptitle("With a smaller font size")
plt.show()