Spaces:
Runtime error
Runtime error
colors
Browse files
app.py
CHANGED
@@ -19,12 +19,13 @@ def ulamspiral(n):
|
|
19 |
cambio_dir = 0
|
20 |
last_x = 0
|
21 |
last_y = 0
|
|
|
22 |
plt.axis('off')
|
23 |
for step in range(1, n+1):
|
24 |
if isprime(step):
|
25 |
-
plt.plot(x, y, "
|
26 |
if step != 1:
|
27 |
-
plt.plot([last_x, x], [last_y, y], "
|
28 |
last_x = x
|
29 |
last_y = y
|
30 |
if estado == 4:
|
@@ -46,6 +47,6 @@ def ulamspiral(n):
|
|
46 |
|
47 |
return plt.gcf()
|
48 |
|
49 |
-
iface = gr.Interface(ulamspiral, gr.inputs.Slider(1,
|
50 |
|
51 |
iface.launch()
|
|
|
19 |
cambio_dir = 0
|
20 |
last_x = 0
|
21 |
last_y = 0
|
22 |
+
plt.figure(facecolor=(0, 0, 0), figsize=(20,20))
|
23 |
plt.axis('off')
|
24 |
for step in range(1, n+1):
|
25 |
if isprime(step):
|
26 |
+
plt.plot(x, y, "wo", markersize=8)
|
27 |
if step != 1:
|
28 |
+
plt.plot([last_x, x], [last_y, y], "w-", markersize=2)
|
29 |
last_x = x
|
30 |
last_y = y
|
31 |
if estado == 4:
|
|
|
47 |
|
48 |
return plt.gcf()
|
49 |
|
50 |
+
iface = gr.Interface(ulamspiral, gr.inputs.Slider(1, 10000, 1), "plot")
|
51 |
|
52 |
iface.launch()
|