|
19 | 19 |
|
20 | 20 | fig, ax = plt.subplots()
|
21 | 21 | # broken_barh(xranges, (ymin, height))
|
22 |
| -ax.broken_barh(cpu_1, (5.8, 0.4)) |
23 |
| -ax.broken_barh(cpu_2, (4.8, 0.4)) |
24 |
| -ax.broken_barh(cpu_3, (3.8, 0.4)) |
| 22 | +ax.broken_barh(cpu_1, (-0.2, 0.4)) |
| 23 | +ax.broken_barh(cpu_2, (0.8, 0.4)) |
| 24 | +ax.broken_barh(cpu_3, (1.8, 0.4)) |
25 | 25 | ax.broken_barh(cpu_4, (2.8, 0.4))
|
26 |
| -ax.broken_barh(disk, (1.8, 0.4), color="tab:orange") |
27 |
| -ax.broken_barh(network, (0.8, 0.4), color="tab:green") |
| 26 | +ax.broken_barh(disk, (3.8, 0.4), color="tab:orange") |
| 27 | +ax.broken_barh(network, (4.8, 0.4), color="tab:green") |
28 | 28 | ax.set_xlim(0, 10)
|
29 |
| -ax.set_yticks([6, 5, 4, 3, 2, 1], |
| 29 | +ax.set_yticks(range(6), |
30 | 30 | labels=["CPU 1", "CPU 2", "CPU 3", "CPU 4", "disk", "network"])
|
| 31 | +ax.invert_yaxis() |
31 | 32 | ax.set_title("Resource usage")
|
32 | 33 |
|
33 | 34 | plt.show()
|
34 |
| - |
35 | 35 | # %%
|
36 | 36 | # .. tags::
|
37 | 37 | #
|
|
0 commit comments