Ravindra BagaleCourses & study guides

13. Visualization with matplotlib

13.3 ₹ Axis Formatting (Simple)

from matplotlib.ticker import FuncFormatter

def inr_lakhs(x, pos):
    return f"₹{x/1e5:.1f}L"

fig, ax = plt.subplots()
ax.bar(gmv.index, gmv.values)
ax.yaxis.set_major_formatter(FuncFormatter(inr_lakhs))
ax.set_ylabel("GMV")
plt.xticks(rotation=30, ha="right")
fig.tight_layout()
plt.show()

Practice task

Create a horizontal bar chart (barh) of the same GMV series sorted ascending. Save as figures/gmv_hbar.png.

Thodkyaat sangaycha tar (quick recap)

  • Use Figure/Axes explicitly
  • Bar / line / hist cover most ops stories
  • Save PNG with savefig; format ₹ axes for managers

Samajla ka? Aata pudhe jaauya visualization with seaborn.