Seaborn के jointplot में एक्सिस लेबल को कस्टमाइज़ करने के लिए आप set_xlabel() और set_ylabel() मेथड्स का उपयोग कर सकते हैं। यह ट्यूटोरियल आपको चरण-दर-चरण प्रक्रिया दिखाता है।
मुख्य चरण
- फिगर का आकार सेट करें और सबप्लॉट्स के बीच पैडिंग एडजस्ट करें।
- NumPy का उपयोग करके x और y डेटा पॉइंट्स बनाएं।
sns.jointplot()से जॉइंट प्लॉट बनाएं।- कस्टम लेबल के लिए
ax_joint.set_xlabel()औरax_joint.set_ylabel()का उपयोग करें। LaTeX फॉर्मेटिंग भी सपोर्टेड है। plt.show()से प्लॉट प्रदर्शित करें।
उदाहरण कोड
import seaborn as sns
import numpy as np
from matplotlib import pyplot as plt
plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True
x = np.random.randn(1000)
y = 0.2 * np.random.randn(1000) + 0.5
h = sns.jointplot(x, y, height=3.50)
h.ax_joint.set_xlabel(r'$\bf{X-Axis\ Label}$')
h.ax_joint.set_ylabel(r'$\bf{Y-Axis\ Label}$')
plt.show()
आउटपुट
ऊपर दिया गया कोड एक जॉइंट प्लॉट उत्पन्न करेगा जिसमें बोल्ड LaTeX-स्टाइल एक्सिस लेबल होंगे।