Skip to content

Commit fc515fc

Browse files
feat(matplotlib): implement line-basic
1 parent 3562c72 commit fc515fc

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

plots/matplotlib/plot/line-basic/default.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@
44
"""
55

66
import matplotlib.pyplot as plt
7-
import pandas as pd
7+
import numpy as np
88

99

1010
# Data
11-
data = pd.DataFrame({"time": [1, 2, 3, 4, 5, 6, 7], "value": [10, 15, 13, 18, 22, 19, 25]})
11+
np.random.seed(42)
12+
time = np.arange(1, 31)
13+
base_value = 10
14+
trend = 0.5 * time
15+
noise = np.random.randn(30) * 2
16+
value = base_value + trend + noise
1217

1318
# Plot
1419
fig, ax = plt.subplots(figsize=(16, 9))
15-
ax.plot(data["time"], data["value"], color="#306998", linewidth=2, marker="o", markersize=6)
20+
ax.plot(time, value, color="#306998", linewidth=2, marker="o", markersize=4)
1621

1722
# Labels and styling
18-
ax.set_xlabel("Time", fontsize=20)
23+
ax.set_xlabel("Time (days)", fontsize=20)
1924
ax.set_ylabel("Value", fontsize=20)
2025
ax.set_title("Basic Line Plot", fontsize=20)
2126
ax.tick_params(axis="both", labelsize=16)

0 commit comments

Comments
 (0)