Commit 3b5e248f authored by Kirill Smelkov's avatar Kirill Smelkov

py2: demo/kpidemo.*: Adjust it for python2

- fix import for urlopen
- there is no subfigures support on matplotlib2 -> use two separate figures.
  this leads to two spearate windows for kpidemo.py, but at least it works somehow.
- omit ConciseDateFormatter - it is present only in matplotlib3
- refresh the notebook
parent c2306e7c
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""kpidemo - plot KPIs computed from enb.xlog
Usage: kpidemo <time period> <enb.xlog uri>
......@@ -17,7 +18,7 @@ from matplotlib import ticker
from datetime import datetime, timedelta
import sys
from urllib.request import urlopen
from urllib2 import urlopen
@func
......@@ -123,8 +124,8 @@ def main():
# all QCIs and does not have uncertainty. QCIs for which throughput data is
# all zeros are said to be silent and are not plotted.
fig = plt.figure(constrained_layout=True, figsize=(12,8))
facc, fthp = fig.subfigures(1, 2)
facc = plt.figure(1)
fthp = plt.figure(2)
figplot_erab_accessibility (facc, vtau, vInititialEPSBEstabSR, vAddedEPSBEstabSR, tperiod)
figplot_eutran_ip_throughput(fthp, vtau, vIPThp_qci, tperiod)
plt.show()
......@@ -210,9 +211,9 @@ def plot_per_qci(ax, vtau, v_qci, label):
# fmt_dates_pretty instructs axis to use concise dates formatting.
def fmt_dates_pretty(axis):
xloc = mdates.AutoDateLocator()
xfmt = mdates.ConciseDateFormatter(xloc)
#xfmt = mdates.ConciseDateFormatter(xloc) # only in matplotlib > 2
axis.set_major_locator(xloc)
axis.set_major_formatter(xfmt)
#axis.set_major_formatter(xfmt)
axis.set_minor_locator(ticker.AutoMinorLocator(5))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment