Browse code

2D: fix the scaling in the plotting of the polygons

Bas Nijholt authored on 30/10/2017 10:12:24
Showing 1 changed files
... ...
@@ -206,13 +206,13 @@
206 206
     "%%opts Contours (alpha=0.3)\n",
207 207
     "from adaptive.learner import *\n",
208 208
     "\n",
209
-    "def plot(self):\n",
210
-    "    tri = self.ip().tri\n",
211
-    "    return hv.Contours([p for p in tri.points[tri.vertices]])\n",
209
+    "def plot(learner):\n",
210
+    "    tri = learner.ip().tri\n",
211
+    "    return hv.Contours([p for p in learner.unscale(tri.points[tri.vertices])])\n",
212 212
     "\n",
213
-    "def plot_poly(self):\n",
214
-    "    tri = self.ip().tri\n",
215
-    "    return hv.Polygons([p for p in tri.points[tri.vertices]])\n",
213
+    "def plot_poly(learner):\n",
214
+    "    tri = learner.ip().tri\n",
215
+    "    return hv.Polygons([p for p in learner.unscale(tri.points[tri.vertices])])\n",
216 216
     "\n",
217 217
     "\n",
218 218
     "(adaptive.live_plot(runner) +\n",
... ...
@@ -614,7 +614,7 @@
614 614
    "name": "python",
615 615
    "nbconvert_exporter": "python",
616 616
    "pygments_lexer": "ipython3",
617
-   "version": "3.6.2"
617
+   "version": "3.6.3"
618 618
   }
619 619
  },
620 620
  "nbformat": 4,