-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot-circle-list-assignment-pgr.py
More file actions
94 lines (83 loc) · 1.94 KB
/
plot-circle-list-assignment-pgr.py
File metadata and controls
94 lines (83 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
'''
Test this.
https://tritech-testsite.smapply.io/
Get the code: 10.183.1.26 code python
Plot circle data using python
- Change the graph line colors
- Change the plot line color
- Change the plot dot color
- Label the graph with text Plotting Circumference and Diameter
- Label the axis with text (Circumference and Diameter)
- Upload to github with your name initials or name attached (plot-circle-list-cwc.py
'''
import turtle
import math
wdth = 800; hgth = 800; bgstring = "#dddded"
red = "#80143C"; green = "#00EF2A"; blue = "#00D9EF"
def grid(t):
x = 0; y = 0
while (x < 400):
t.penup()
t.goto(x,y)
t.pendown()
t.goto(x,y+400)
x = x + 50
x = 0; y = 0
while (y < 400):
t.penup()
t.goto(x,y)
t.pendown()
t.goto(x+400,y)
y = y + 50
t.penup()
def plotCircles(t):
d = [12.26, 17.27, 22.25, 11]
c = [3*9, 3*5.5, 3*7, 3*3.5 ]
dsorted = sorted (d, key = float)
csorted = sorted(c , key = float)
t.goto(0,0)
t.pendown()
t.dot(3, red)
t.goto(dsorted[0],csorted[0])
t.dot(3, red)
t.goto(dsorted[1],csorted[1])
t.dot(3, red)
t.goto(dsorted[2],csorted[2])
t.dot(3, red)
t.goto(dsorted[3],csorted[3])
t.dot(3, red)
t.penup()
t.goto(-20,-20)
t.pendown()
t.color('blue')
style = ('Courier', 10, 'italic')
t.write('Axis', font=style, align='center')
t.penup()
t.goto(0,-200)
t.pendown()
t.color('blue')
style = ('Courier', 10, 'italic')
t.write('Circumfrance and Diameter Plot', font=style, align='center')
def main():
try:
turtle.TurtleScreen._RUNNING = True
# get wdth and hgth globally
turtle.screensize(canvwidth=wdth, canvheight=hgth, bg=bgstring)
print(turtle.Screen().screensize())
w = turtle.Screen()
t = turtle.Turtle()
t.hideturtle()
t.color('magenta')
grid(t)
plotCircles(t)
w.exitonclick()
finally:
turtle.Terminator()
if __name__ == '__main__':
main()
'''
# Using sorted + key
Output = sorted(Input, key = float)
# Using sorted + key
Output = sorted(Input, key = float)
'''