Created using Colab
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"provenance": [],
|
||||
"authorship_tag": "ABX9TyMDnVKMFeK2nRxX862l3xmp",
|
||||
"authorship_tag": "ABX9TyPss+SDCn3GEVlRYmKVEPWE",
|
||||
"include_colab_link": true
|
||||
},
|
||||
"kernelspec": {
|
||||
@@ -83,31 +83,6 @@
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Function to help plot the data\n",
|
||||
"def plot(x, y, f, phi0=None, phi1=None):\n",
|
||||
" fig,ax = plt.subplots()\n",
|
||||
" ax.scatter(x,y)\n",
|
||||
" plt.xlim([0,2.0])\n",
|
||||
" plt.ylim([0,2.0])\n",
|
||||
" ax.set_xlabel('Input, $x$')\n",
|
||||
" ax.set_ylabel('Output, $y$')\n",
|
||||
" ax.set_aspect('equal')\n",
|
||||
" # Draw line if parameters passed\n",
|
||||
" x_line = np.arange(0,2,0.01)\n",
|
||||
" if(phi0 is not None and phi1 is not None):\n",
|
||||
" y_line = f(x_line, phi0, phi1)\n",
|
||||
" plt.plot(x_line, y_line,'r-',lw=2)\n",
|
||||
" plt.show()"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "785wp16FYjt5"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
@@ -140,6 +115,31 @@
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Function to help plot the data\n",
|
||||
"def plot(x, y, f, phi0=None, phi1=None):\n",
|
||||
" fig,ax = plt.subplots()\n",
|
||||
" ax.scatter(x,y)\n",
|
||||
" plt.xlim([0,2.0])\n",
|
||||
" plt.ylim([0,2.0])\n",
|
||||
" ax.set_xlabel('Input, $x$')\n",
|
||||
" ax.set_ylabel('Output, $y$')\n",
|
||||
" ax.set_aspect('equal')\n",
|
||||
" # Draw line if parameters passed\n",
|
||||
" x_line = np.arange(0,2,0.01)\n",
|
||||
" if(phi0 is not None and phi1 is not None):\n",
|
||||
" y_line = f(x_line, phi0, phi1)\n",
|
||||
" plt.plot(x_line, y_line,'r-',lw=2)\n",
|
||||
" plt.show()"
|
||||
],
|
||||
"metadata": {
|
||||
"id": "785wp16FYjt5"
|
||||
},
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
|
||||
Reference in New Issue
Block a user