# 13.2 Line chart आणि histogram

Source: https://ravindrabagale.com/mr/datascience/ch13-visualization-with-matplotlib/13-2-line-and-hist.html
Language: mr (Marathi with English technical terms)

या काल्पनिक series मध्ये दिवस 5–6 ला जास्त orders देऊन spike दाखवला आहे. हा teaching pattern आहे; वास्तविक दिवाळीच्या तारखांचा दावा नाही.

# Fictional daily orders in Pune around Diwali
days = list(range(1, 11))
orders = [180, 190, 210, 250, 900, 880, 400, 220, 200, 190]

fig, ax = plt.subplots()
ax.plot(days, orders, marker="o")
ax.set_title("Pune daily orders (fictional) — Diwali spike")
ax.set_xlabel("Day of October 2026")
ax.set_ylabel("Orders")
ax.axhline(500, linestyle="--", label="Spike threshold")
ax.legend()
plt.show()

Delivery minutes कसे पसरले आहेत हे histogram मधून पाहू:

mins = [9, 12, 11, 14, 18, 10, 8, 13, 16, 17, 11, 9]
fig, ax = plt.subplots()
ax.hist(mins, bins=5)
ax.set_title("Delivery minutes distribution (fictional sample)")
ax.set_xlabel("Minutes")
ax.set_ylabel("Count")
plt.show()

Jupyter मध्ये steps

City GMV चा bar chart करा.

Sambhaji Nagar नीट वाचता यावं म्हणून x labels rotate करा.

Threshold line असलेला orders line chart करा.

त्या line chart च्या fig वर fig.savefig("figures/pune_diwali.png", dpi=120) run करा.

दिवस 5–6 चा spike स्पष्ट दिसेल आणि figures/ मध्ये PNG तयार होईल. Histogram बनवल्यावर fig बदलतो; म्हणून line chart save त्याच वेळी करा किंवा त्याचा वेगळा reference ठेवा.

रवींद्र बागले यांची tip

Chart चा screenshot काढण्यापेक्षा savefig वापरा. PNG पुन्हा त्याच code मधून बनवता येतो आणि quality चांगली राहते. स्वतःच्या reports साठी PNG/JPG वापरू शकता.
