Pyplot snippet¶
2024
Basic line plot¶
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(5, 5))
x = [1, 3, 5, 6, 8, 9]
y = [19, 34, 59, 96, 98, 99]
text_size="large"
plt.plot(x, y, linestyle="-", marker="o", label="test", linewidth=1, markersize=5, markeredgewidth=0.0, color="xkcd:blue")
plt.grid(True, linestyle='--', linewidth=0.5, alpha=0.7)
plt.xlabel(xlabel="x", fontsize=text_size)
plt.ylabel(ylabel="y", fontsize=text_size)
plt.legend(loc="best",prop={"size":text_size})
plt.savefig("basiclineplot.svg", bbox_inches="tight")
Fig. 2 Basic line plot¶