* GULISTON DAVLAT UNIVERSITETI AXBOROTNOMASI *
* Gumanitar
– ijtimoiy fanlar seriyasi, 2023. № 1 *
39
Pythonda aylanani ko'rsatish uchun obj = Circle(Point(x, y), R)
x, y - aylana markazining koordinatalari,
R - aylana radiusi.
Grafik oynada doira ko'rsatadigan Python dasturiga misol.
grafik importidan *
win = GraphWin("Grafika oynasi",
obj = Circle(Point(200, 200), 50)
obj.draw(win)
win.getMouse()
win.close()
Python to'rtburchak chizish uchun [5]:
obj = Rectangle(Point(x1, y1), Point(x2 ) dan foydalanadi. , y2))
x1, y1 - to'rtburchakning yuqori chap burchagining koordinatalari,
x2, y2 - to'rtburchakning pastki o'ng burchagining koordinatalari.
Matplotlib Pythonda statik, animatsiyali va interaktiv vizualizatsiya yaratish uchun keng qamrovli kutubxona.
Diagrammada (-10,0) pozitsiyadan (0,200) pozitsiyaga chiziq torting:
import matplotlib.pyplot
as plt
import
numpy as np
xpoints = np.array([-10, 6])
ypoints = np.array([0, 200])
plt.plot(xpoints, ypoints)
plt.show()
Matplotlib belgilari:
import matplotlib.pyplot as plt
import numpy as np
ypoints = np.array([1, 8, 1, 8, 1])
plt.plot(ypoints, marker = 'r', ms = 20, mec = 'r', mfc = 'r')
plt.show()
Matplotlib dagi marker belgilari haqida quydagi havoladan ko‘rishingiz mumkun.
https://matplotlib.org/stable/api/markers_api.htm.
Pyplot yordamida siz bar()shtrixli grafiklarni chizish uchun funktsiyadan foydalanishingiz mumkin:
import matplotlib.pyplot as plt
import numpy as np
x = np.array(["A", "B", "C", "D"])
y = np.array([3, 8, 1, 10])