diff --git a/1.py b/1.py new file mode 100644 index 000000000..1a34e52fe --- /dev/null +++ b/1.py @@ -0,0 +1,7 @@ +import matplotlib.pyplot as plt + +# график по точкам + +plt.plot([1,1,5,5,1],[1,5,5,1,1]) +plt.axis('equal') +plt.savefig('sqare.png') # сохранение графика diff --git a/2.py b/2.py new file mode 100644 index 000000000..254e69de4 --- /dev/null +++ b/2.py @@ -0,0 +1,16 @@ +import matplotlib.pyplot as plt +import numpy as np + +a = 1 +b = 1 +c = -6 +x0 = -5 +xk = 5 +n = 100 +xsd = [x for x in np.linspace(x0,0,n)] +xsp = [x for x in np.linspace(0,xk,n)] +yd = [1/i for i in xsd] +yp = [1/i for i in xsp] +plt.plot(xsd,yd) +plt.plot(xsp,yp) +plt.savefig('mygiperbola.png') # сохранение графика \ No newline at end of file diff --git a/3_elips.py b/3_elips.py new file mode 100644 index 000000000..ad242ff81 --- /dev/null +++ b/3_elips.py @@ -0,0 +1,17 @@ +# (x**2)/(a**2)+(y**2)/(b**2) = 1 +# y = +- (b**2 * (1 - (x**2)/(a**2))) + +import matplotlib.pyplot as plt +import numpy as np + +a = 5 +b = 2 + +x = [i for i in np.linspace(-5,5)] +y1 = [(b**2 * (1 - (j**2)/(a**2))) for j in x] +y2 = [-(b**2 * (1 - (l**2)/(a**2))) for l in x] + +plt.plot(x,y1) +plt.plot(x,y2) + +plt.savefig('ellipse') # сохранение графика \ No newline at end of file diff --git a/ellipse.png b/ellipse.png new file mode 100644 index 000000000..a408b74e1 Binary files /dev/null and b/ellipse.png differ diff --git a/fig1.png b/fig1.png new file mode 100644 index 000000000..a05fca4d0 Binary files /dev/null and b/fig1.png differ diff --git a/mygiperbola.png b/mygiperbola.png new file mode 100644 index 000000000..5d98ccb9a Binary files /dev/null and b/mygiperbola.png differ diff --git a/myparabola.png b/myparabola.png new file mode 100644 index 000000000..4a41ccf73 Binary files /dev/null and b/myparabola.png differ diff --git a/sqare.png b/sqare.png new file mode 100644 index 000000000..1a71b8621 Binary files /dev/null and b/sqare.png differ diff --git "a/\320\263\321\200\320\260\321\204\320\270\320\272 \321\207\320\265\321\200\320\265\320\267 \320\277\320\260\320\271\320\277\320\273\320\276\321\202.py" "b/\320\263\321\200\320\260\321\204\320\270\320\272 \321\207\320\265\321\200\320\265\320\267 \320\277\320\260\320\271\320\277\320\273\320\276\321\202.py" new file mode 100644 index 000000000..cc6caa7a5 --- /dev/null +++ "b/\320\263\321\200\320\260\321\204\320\270\320\272 \321\207\320\265\321\200\320\265\320\267 \320\277\320\260\320\271\320\277\320\273\320\276\321\202.py" @@ -0,0 +1,6 @@ +import matplotlib.pyplot as plt + +# график по точкам + +plt.plot([1,2,3],[5,7,10]) +plt.savefig('fig1.png') # сохранение графика \ No newline at end of file diff --git "a/\321\203\320\272\321\200\320\260\321\210\320\260\321\202\320\265\320\273\321\214\321\201\321\202\320\262\320\260.py" "b/\321\203\320\272\321\200\320\260\321\210\320\260\321\202\320\265\320\273\321\214\321\201\321\202\320\262\320\260.py" new file mode 100644 index 000000000..fa17457d8 --- /dev/null +++ "b/\321\203\320\272\321\200\320\260\321\210\320\260\321\202\320\265\320\273\321\214\321\201\321\202\320\262\320\260.py" @@ -0,0 +1,13 @@ +import matplotlib.pyplot as plt + +# допы для графика + +x = [1,2,3] +y = [4,5,6] + +plt.plot(x,y,color='g', label = 'graf 1', ms = 5) +plt.plot(y,x,color='r', label = 'graf 2', ms = 3) + +plt.xlabel('coord: x') +plt.ylabel('coord: y') +plt.legend()