Closed as not planned
Description
Bug summary
I run into issues in using mayplotlib and only yields pixeled dotted lines with no readability.
Anyone knows how to fix it?
Code for reproduction
import matplotlib.pyplot as plt
load = [
65.0, 65.0, 65.0, 65.0,
62.0, 62.0, 62.0, 62.0,
59.0, 59.0, 59.0, 59.0,
69.0, 69.0, 69.0, 69.0,
70.0, 70.0, 70.0, 70.0,
61.0, 61.0, 61.0, 61.0,
70.0, 70.0, 70.0, 70.0,
82.0, 82.0, 82.0, 82.0,
92.0, 92.0, 92.0, 92.0,
97.0, 97.0, 97.0, 97.0,
98.0, 98.0, 98.0, 98.0,
96.0, 96.0, 96.0, 96.0,
96.0, 96.0, 96.0, 96.0,
94.0, 94.0, 94.0, 94.0,
93.0, 93.0, 93.0, 93.0,
95.0, 95.0, 95.0, 95.0,
96.0, 96.0, 96.0, 96.0,
96.0, 96.0, 96.0, 96.0,
95.0, 95.0, 95.0, 95.0,
93.0, 93.0, 93.0, 93.0,
89.0, 89.0, 89.0, 89.0,
80.0, 80.0, 80.0, 80.0,
68.0, 68.0, 68.0, 68.0
]
t = np.arange(0, 23, 0.25) # 15-min resolution in hours
fig, ax = plt.subplots(figsize=(12, 4), dpi=140) # bigger & sharper
ax.step(t, load, where="post", lw=2) # solid 2-pt staircase
ax.set_xlim(0, 24)
ax.set_xticks(np.arange(0, 25, 2))
ax.set_xlabel("Hour of day")
ax.set_ylabel("% of daily peak")
ax.set_title("IEEE RTS – Typical Daily Load Profile")
ax.grid(ls="--", alpha=0.3) # light, unobtrusive grid
plt.tight_layout()
plt.show()
Actual outcome
Expected outcome
readable figures
Additional information
No response
Operating system
No response
Matplotlib Version
3.8.4
Matplotlib Backend
No response
Python version
3.9
Jupyter version
No response
Installation
pip