meta: add turtle/matplotlib examples by Critor

This commit is contained in:
Lephenixnoir 2024-01-07 16:05:40 +01:00
parent b6efd9ed31
commit 9f860bd58a
Signed by untrusted user: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,7 @@
from matplotl import *
x = [119.1, 119.3, 119.5, 119.6, 119.9, 120.0, 120.1, 120.3, 120.4]
y = [1, 3, 4, 3, 1, 3, 1, 3, 1]
bar(x, y, 0.08)
show()

View File

@ -0,0 +1,23 @@
import turtle
from math import exp
def try_colormode(m):
try: turtle.colormode(m)
except: pass
def try_pencolor(c):
try: turtle.pencolor(c)
except: pass
try: turtle.color(c)
except: pass
try_colormode(1)
turtle.penup()
turtle.goto(0, -20)
turtle.pendown()
for i in range(1,37):
red=(exp(-0.5 * ((i-6)/12)**2))
green=(exp(-0.5 * ((i-18)/12)**2))
blue=(exp(-0.5 * ((i-30)/12)**2))
try_pencolor([red,green,blue])
turtle.circle(50-i)
turtle.right(10)