This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
# importing data from csv file | |
xs, ys, zs = np.loadtxt("data.txt", unpack=True, delimiter=",", dtype=float) | |
# plotting | |
plt.plot(xs, ys, "b-", label="line one") # blue line, label displayed in legend | |
plt.plot(xs, zs, "r-", label="line two") # red line, for scatter plot replace with "ro" |