Added questions to all problem pages, solution workings for days 1 and 2
[ou-summer-of-code-2017.git] / 06-tour-shapes / tour-creation-for-background.ipynb
index 74716dfbb4714f99fe0c0ce7a92b0f29319298cd..e9848a5be14cc87742c55a7185ab4a446cc3505b 100644 (file)
    },
    "outputs": [],
    "source": [
-    "def plot_trace(trace, colour='k', xybounds=None, fig=None, subplot_details=None, filename=None):\n",
+    "def plot_trace(trace, colour='k', highlight_start=True,\n",
+    "               xybounds=None, fig=None, subplot_details=None, filename=None):\n",
     "    plt.axis('on')\n",
     "    plt.axes().set_aspect('equal')\n",
+    "        \n",
+    "    if highlight_start:\n",
+    "        plt.axes().add_patch(plt.Circle((trace[0].x, trace[0].y), 0.2, color=colour))\n",
+    "        \n",
     "    for s, t in chunks(trace, 2):\n",
     "        w, h = plot_wh[t.dir]\n",
     "        plt.arrow(s.x, s.y, w, h, head_width=0.1, head_length=0.1, fc=colour, ec=colour, length_includes_head=True)\n",