Data Science · मराठी आवृत्ती
13.3 ₹ axis लाखांमध्ये दाखवूया
या page मध्ये
मोठ्या amounts वाचायला सोप्या व्हाव्यात म्हणून ₹ आणि लाखांचं L असं formatting करूया:
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
त्याच GMV Series ला ascending sort करा आणि barh ने horizontal bar chart बनवा. figures/gmv_hbar.png म्हणून save करा.
Recap
- Figure आणि Axes स्पष्टपणे वापरा.
- Bar, line आणि histogram अनेक operations प्रश्नांसाठी पुरतात.
- PNG साठी savefig; manager साठी ₹ axis वाचायला सोपी करा.
पुढे seaborn पाहूया.