Series: Python for kids
In our endavor to make learning fun and free of memorization, we have been using Python to allow children to experiment and analyze data to form their own opinion and discover facts. This way, children engage is learning process with more intensity and the they show higher retention rate vis a vis conventional learning.
This makes them think and try different things before they get it right. The focus shifts from being always ‘right’ to get it right after several failed attempts. In this part of the series
Children create simple shapes using markers, move marker left, right, front, back, up and down. They learn coordinates geometry where the position of points on the 3D plane.
In this blog we are using Matplotlibn library. Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy.
ipympl enables the interactive features of matplotlib in the Jupyter notebook and in JupyterLab. To enable the ipympl backend, simply use the matplotlib Jupyter magic: # %matplotlib widget
import matplotlib.pyplot as plt
import numpy as np
# %matplotlib widget
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red', marker = '*')
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'green', marker = 'o')
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red',
marker = 'o', markersize = 20)
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red', marker = '^', markersize = 20)
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red', marker = '^', markersize = 10)
ax.plot(1, 0, 0, color = 'green', marker = 'o', markersize = 10)
ax.plot(-1, 0, 0, color = 'blue', marker = 'o', markersize = 10)
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red', marker = '^', markersize = 10)
ax.plot(1, 0, 0, color = 'green', marker = 'o', markersize = 10)
ax.plot(-1, 0, 0, color = 'blue', marker = 'o', markersize = 10)
ax.plot(0, 1, 0, color = 'yellow', marker = 'o', markersize = 10)
ax.plot(0, -1, 0, color = 'purple', marker = 'o', markersize = 10)
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red', marker = '^', markersize = 10)
ax.plot(1, 0, 0, color = 'green', marker = 'o', markersize = 10)
ax.plot(-1, 0, 0, color = 'blue', marker = 'o', markersize = 10)
ax.plot(0, 1, 0, color = 'yellow', marker = 'o', markersize = 10)
ax.plot(0, -1, 0, color = 'purple', marker = 'o', markersize = 10)
ax.plot(0, 0, 1, color = 'cyan', marker = 'o', markersize = 10)
ax.plot(0, 0, -1, color = 'black', marker = 'o', markersize = 10)
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red', marker = '^', markersize = 10)
ax.text(0 + 0.03, 0 + 0.01, 0 + 0.01, s = 'O', fontsize = 10)
ax.plot(1, 0, 0, color = 'green', marker = 'o', markersize = 10)
ax.plot(-1, 0, 0, color = 'blue', marker = 'o', markersize = 10)
ax.plot(0, 1, 0, color = 'yellow', marker = 'o', markersize = 10)
ax.plot(0, -1, 0, color = 'purple', marker = 'o', markersize = 10)
ax.plot(0, 0, 1, color = 'cyan', marker = 'o', markersize = 10)
ax.plot(0, 0, -1, color = 'black', marker = 'o', markersize = 10)
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red', marker = '^', markersize = 10)
ax.text(0 + 0.03, 0 + 0.01, 0 + 0.01, s = 'O', fontsize = 10)
ax.plot(1, 0, 0, color = 'green', marker = 'o', markersize = 10)
ax.plot(-1, 0, 0, color = 'blue', marker = 'o', markersize = 10)
ax.plot(
[1, -1],
[0, 0],
[0, 0]
)
ax.plot(0, 1, 0, color = 'yellow', marker = 'o', markersize = 10)
ax.plot(0, -1, 0, color = 'purple', marker = 'o', markersize = 10)
ax.plot(0, 0, 1, color = 'cyan', marker = 'o', markersize = 10)
ax.plot(0, 0, -1, color = 'black', marker = 'o', markersize = 10)
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red', marker = '^', markersize = 10)
ax.text(0 + 0.03, 0 + 0.01, 0 + 0.01, s = 'O', fontsize = 10)
ax.plot(1, 0, 0, color = 'green', marker = 'o', markersize = 10)
ax.plot(-1, 0, 0, color = 'blue', marker = 'o', markersize = 10)
ax.plot(
[1, -1],
[0, 0],
[0, 0]
)
ax.plot(0, 1, 0, color = 'yellow', marker = 'o', markersize = 10)
ax.plot(0, -1, 0, color = 'purple', marker = 'o', markersize = 10)
ax.plot(
[0, 0],
[1, -1],
[0, 0]
)
ax.plot(0, 0, 1, color = 'cyan', marker = 'o', markersize = 10)
ax.plot(0, 0, -1, color = 'black', marker = 'o', markersize = 10)
plt.show()
fig = plt.figure(figsize = (5, 5))
ax = plt.axes(projection='3d')
ax.plot(0, 0, 0, color = 'red', marker = '^', markersize = 10)
ax.text(0 + 0.03, 0 + 0.01, 0 + 0.01, s = 'O', fontsize = 10)
ax.plot(1, 0, 0, color = 'green', marker = 'o', markersize = 10)
ax.plot(-1, 0, 0, color = 'blue', marker = 'o', markersize = 10)
ax.plot(
[1, -1],
[0, 0],
[0, 0]
)
ax.plot(0, 1, 0, color = 'yellow', marker = 'o', markersize = 10)
ax.plot(0, -1, 0, color = 'purple', marker = 'o', markersize = 10)
ax.plot(
[0, 0],
[1, -1],
[0, 0]
)
ax.plot(0, 0, 1, color = 'cyan', marker = 'o', markersize = 10)
ax.plot(0, 0, -1, color = 'black', marker = 'o', markersize = 10)
ax.plot(
[0, 0],
[0, 0],
[1, -1]
)
plt.show()