Featured image of post Python (matplotlib.pyplot) का उपयोग करके ग्राफ़ कैसे बनाएं

Python (matplotlib.pyplot) का उपयोग करके ग्राफ़ कैसे बनाएं

img_1.png

आपको क्या चाहिए

  • Google खाता

चरण

  1. https://colab.research.google.com/ पर जाएं
  2. “फ़ाइल” -> “नई नोटबुक” चुनें
  3. नीचे दिए गए कोड को पेस्ट करें और चलाएं
1
2
3
4
5
6
7
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 2*np.pi, 500)
plt.plot(x, np.sin(x), label="sin curve")
plt.plot(x, np.cos(x), label="cos curve")
plt.legend() # लीजेंड दिखाएं
plt.show()

निष्पादन परिणाम

img.png

संदर्भ

comments powered by Disqus
निर्मित Hugo के साथ
थीम Stack द्वारा डिज़ाइन किया गया Jimmy