Plot Line Chart From Text File Using Pandas and Matplotlib (Python) in CLI

Sample Data Files

12368.30000000
12294.94000000
12320.71000000
12339.38000000
12310.33000000

Dependencies

pip install pandaspip install matplotlib

Code

import pandas as pdimport matplotlib.pyplot as pltdf = pd.read_csv('data.txt', header=None)df.plot.line()plt.show()

NOTE: matplotlib.pyplot.show

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.