Matplotlib for SNMP results

In our first Matplotlib example, namely matplotlib_1.py, we will import the dates module besides pyplot. We will use the matplotlib.dates module instead of the Python standard library dates module. Unlike the Python dates module, the mapplotlib.dates library will convert the date value internally into the float type, which is required by Matplotlib:

  import matplotlib.pyplot as plt  import matplotlib.dates as dates
Matplotlib provides sophisticated date plotting capabilities; you can find more information on this at http://matplotlib.org/api/dates_api.html.

In the script, we will create two empty lists, each representing the x-axis and y-axis values. Note that, on line 12, we used the built-in eval() Python function ...

Get Mastering Python Networking - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.