O'Reilly logo

Matplotlib for Python Developers by Sandro Tosi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Real-time plots update

In several situations, data is generated in real time, and we want to plot it as it comes. Being able to process data and generate dynamic plots that are continuously updated is very interesting.

We are going to present an example where we take a sample of a quantity, and we show its progression in a real-time plot.

The information we will collect is CPU utilization; in a modern operating system, there are several processes always running on a machine, each using a part of the CPU time. On a Unix system, we can identify the major part of the time as being used by:

  • System processes (sys)
  • User processes (user)
  • User processes with lower priority, for example, for background processing (nice)
  • Time not used (idle)

Between parenthesis, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required