Note what you need to remember in Matplotlib (God article There was, maybe I can do it all here lol)
head | head | head |
---|---|---|
sample1 | sample2 | sample3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
1 | 2 | 3 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
10 | 20 | 30 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
100 | 200 | 300 |
import matplotlib as mpl
import matplotlib.pyplot as plt
df = pd.read_csv("./matplotlib1.csv")
name="sample1"
x = df.index
y = df[name]
plt.figure(figsize=(6, 4), dpi=72, tight_layout=True)
plt.title('title')
plt.tick_params(bottom=False)
plt.plot(x, y, label=name)
plt.ylabel("value")
plt.xlabel("index")
plt.legend(loc="upper left",bbox_to_anchor=(1, 1))
plt.grid()
Recommended Posts