Wednesday, February 19, 2020

MatPlotLib With Live Data

If you are doing any charting with python, then you have probably used the matplotlib library. This library is full of features for creating attractive charts of your python-based data.

That's all well and good, but there's something else: You can chart live data with matplotlib! That's right--you can actually create python charts that update in real time. Actually, it is more of a "polling" system in which you create a chart animation function that will be called on a specified interval (1 second, 5 seconds, etc.). The effect is pretty sweet.

The code I'm playing around with for real-time python charts is in my Misc-python public GitHub repo (along with a bunch of other python code):
https://github.com/mdhatmaker/Misc-python/tree/master/Plot/matplotlib


You'll need to run live_data_plot.py and live_data_gen.py at the same time (one plots the data generated by the other). And make sure you run these from the same directory so the "live_data.csv" file can be located by both.

Final Note


If you are doing any python programming, make sure to check out Corey Schafer's YouTube channel. He is doing some really cool tutorials, especially for python and a variety of python libraries. I have used his channel to brush up on more specialized aspects of the python language, matplotlib, numpy, Flask, and a variety of other topics. Highly recommended.


1 comment:

  1. Placing inside bets is either choosing the exact variety of the pocket the ball will land in, or a small vary of pockets based mostly on their proximity on the layout. Players wishing 카지노사이트 to bet on the 'outside' will select bets on bigger positional groupings of pockets, the pocket colour, or whether or not the winning quantity is odd or even. The payout odds for every type of bet are based mostly on its chance. To determine the winning quantity, a croupier spins a wheel in a single direction, then spins a ball in the opposite direction|the other way|the incorrect way} around a tilted round monitor running around the outer fringe of the wheel. The winnings are then paid to anyone who has positioned a successful bet.

    ReplyDelete