Hello, everyone!
I’d concluded my constellation project - Data Scientist path. I’ll enjoy your feedback"
Thanks!
The code is a Jupyter notebook.
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#SETUP\n",
"%matplotlib\n",
"from matplotlib import pyplot as plt\n",
"from mpl_toolkits.mplot3d import Axes3D\n",
"\n",
"\n",
"# Orion\n",
"x = [-0.41, 0.57, 0.07, 0.00, -0.29, -0.32,-0.50,-0.23, -0.23]\n",
"y = [4.12, 7.71, 2.36, 9.10, 13.35, 8.13, 7.19, 13.25,13.43]\n",
"z = [2.06, 0.84, 1.56, 2.07, 2.36, 1.72, 0.66, 1.25,1.38]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#2D VISUALIZATION\n",
"fig=plt.figure(figsize=(15,10))\n",
"fig.add_subplot(1,1,1)\n",
"plt.scatter(x,y)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#3D VISUALIZATION\n",
"fig_3d=plt.figure(figsize=(15,10))\n",
"ax1=fig_3d.add_subplot(1,1,1,projection=\"3d\")\n",
"plt.title('Orion Constellation')\n",
"constellation3d=ax1.scatter(x,y,z)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using matplotlib backend: Qt5Agg\n"
]
}
],
"source": [
"#3D VISUALIZATION\n",
"# Orion\n",
"x = [-0.41, 0.57, 0.07, 0.00, -0.29, -0.32,-0.50,-0.23, -0.23]\n",
"y = [4.12, 7.71, 2.36, 9.10, 13.35, 8.13, 7.19, 13.25,13.43]\n",
"z = [2.06, 0.84, 1.56, 2.07, 2.36, 1.72, 0.66, 1.25,1.38]\n",
"omicron=[7.195, 14.63, -2.191]\n",
"alpha_centauri=[-1.643, -1.374, -3.838]\n",
"proxima_centauri=[-1.539, -1.178, -3.752]\n",
"ox=[omicron[0]]\n",
"oy=[omicron[1]]\n",
"oz=[omicron[2]]\n",
"x_=[alpha_centauri[0],proxima_centauri[0]]\n",
"y_=[alpha_centauri[1],proxima_centauri[1]]\n",
"z_=[alpha_centauri[2],proxima_centauri[2]]\n",
"fig2=plt.figure(figsize=(10,12))\n",
"ax=fig2.add_subplot(1,1,1,projection=\"3d\")\n",
"centauri=ax.scatter(x_,y_,z_)\n",
"omicron=ax.scatter(ox,oy,oz)\n",
"orion=ax.scatter(x,y,z)\n",
"plt.title('Constellations: Orion, Centauri & Omicron')\n",
"plt.legend(['Centauri','Omicron','Orion'])\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}