Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
uyegy
CPUnetPLOT
Commits
c6eeefb6
Commit
c6eeefb6
authored
Aug 12, 2014
by
Mario Hock
Browse files
subplot pendent
parent
571956e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
simple_plotter.py
View file @
c6eeefb6
...
...
@@ -60,7 +60,10 @@ if __name__ == "__main__":
# Twin plot
# (see http://matplotlib.org/examples/api/two_scales.html)
fig
,
ax1
=
plt
.
subplots
()
#fig, ax1 = plt.subplots() ## twin
fig
,
axes
=
plt
.
subplots
(
2
,
1
,
sharex
=
True
)
(
ax1
,
ax2
)
=
axes
plt
.
ylim
(
0
,
10
**
10
)
ax1
.
set_ylabel
(
'Throughput (Bit/s)'
)
...
...
@@ -68,8 +71,9 @@ if __name__ == "__main__":
ax1
.
plot
(
x_values
,
cols
[
col_name
],
label
=
col_name
)
ax1
.
plot
(
x_values
,
calc_ema
(
cols
[
col_name
],
0.2
),
label
=
col_name
+
" (ema)"
)
ax1
.
legend
()
ax2
=
ax1
.
twinx
()
#
ax2 = ax1.twinx()
## twin
plt
.
ylim
(
0
,
100
)
ax2
.
set_ylabel
(
'CPU util (%)'
)
...
...
@@ -77,7 +81,6 @@ if __name__ == "__main__":
ax2
.
plot
(
x_values
,
cols
[
col_name
],
label
=
col_name
)
#ax2.plot(x_values , calc_ema(cols[col_name], 0.2), label=col_name+" (ema)")
## TODO twinx:
ax2
.
legend
()
plt
.
legend
()
plt
.
show
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment