# 13.3 ₹ axis लाखांमध्ये दाखवूया

Source: https://ravindrabagale.com/mr/datascience/ch13-visualization-with-matplotlib/13-3-axis-formatting-simple.html
Language: mr (Marathi with English technical terms)

मोठ्या 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 पाहूया.

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

Formatting मुळे data बदलत नाही; फक्त label बदलतो. ₹1.0L म्हणजे ₹100000 हे report वाचणाऱ्याला स्पष्ट असू द्या.
