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

July 15, 2019

Sample Data Files

12368.30000000
12294.94000000
12320.71000000
12339.38000000
12310.33000000

Dependencies

pip install pandas
pip install matplotlib

Code

import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv('data.txt', header=None)
df.plot.line()
plt.show()

NOTE: matplotlib.pyplot.show

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.