GitHub PullRequestReviewCommentEvent at 2014-05-23 15:27:08
Repository: Schweizer-Messer
Actor: furgalep
Payload: {"comment":{"url":"https://api.github.com/repos/ethz-asl/Schweizer-Messer/pulls/comments/13004143","id":13004143,"diff_hunk":"@@ -0,0 +1,79 @@\n+import wxversion\n+wxversion.ensureMinimal('2.8')\n+\n+import wx\n+import wx.aui\n+import matplotlib as mpl\n+from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas\n+from matplotlib.backends.backend_wxagg import NavigationToolbar2Wx as Toolbar\n+import collections\n+\n+#This class places matplot figures in tabs on a wx window\n+#(make sure to use unique figure ids between different PlotCollection instances \n+# or wxwidget may segfault)\n+#e.g. usage:  \n+#      import sm\n+#      import pylab as pl\n+#\n+#      #create the plot as usual\n+#      fig1=pl.figure()\n+#      pl.plot([1,2],[2,3])\n+#      fig2=pl.figure()\n+#      pl.plot([3,1],[4,5])\n+#  \n+#      #add to collection\n+#      plotter = sm.PlotCollection(\"My window name\")\n+#      plotter.add_figure(\"My plot1 name\", fig1)\n+#      plotter.add_figure(\"My plot2 name\", fig2)\n+#  \n+#      #show collection\n+#      plotter.show()\n+\n+class PlotCollection:\n+    def __init__(self, frame_name=\"\", window_size=(800,600)):\n+        self.frame_name = frame_name\n+        self.window_size = window_size\n+        self.figureList = collections.OrderedDict()\n+    \n+    def add_figure(self, name, fig):\n+        self.figureList[name] = fig\n+        \n+    def delete_figure(self, name):\n+        self.figureList.pop(name, None)\n+    \n+    def show(self):\n+        if len(self.figureList.keys()) == 0:\n+            return\n+        app = wx.PySimpleApp()\n+        frame = wx.Frame(None,-1,self.frame_name, size=self.window_size)\n+        plotter = self.PlotNotebook(frame)\n+        for name in self.figureList.keys():\n+            plotter.add(name, self.figureList[name])\n+        frame.Show()\n+        app.MainLoop()\n+    \n+    class Plot(wx.Panel):","path":"sm_python/python/sm/PlotCollection.py","position":55,"original_position":55,"commit_id":"e65c05ff1fc645d1e354d256656782a08c5eefb8","original_commit_id":"e65c05ff1fc645d1e354d256656782a08c5eefb8","user":{"login":"furgalep","id":1216052,"avatar_url":"https://avatars.githubusercontent.com/u/1216052?","gravatar_id":"a0a3427ec0933500cf43483b4cb0b8c2","url":"https://api.github.com/users/furgalep","html_url":"https://github.com/furgalep","followers_url":"https://api.github.com/users/furgalep/followers","following_url":"https://api.github.com/users/furgalep/following{/other_user}","gists_url":"https://api.github.com/users/furgalep/gists{/gist_id}","starred_url":"https://api.github.com/users/furgalep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furgalep/subscriptions","organizations_url":"https://api.github.com/users/furgalep/orgs","repos_url":"https://api.github.com/users/furgalep/repos","events_url":"https://api.github.com/users/furgalep/events{/privacy}","received_events_url":"https://api.github.com/users/furgalep/received_events","type":"User","site_admin":false},"body":"Some short comments?","created_at":"2014-05-23T15:27:08Z","updated_at":"2014-05-23T15:27:08Z","html_url":"https://github.com/ethz-asl/Schweizer-Messer/pull/83#discussion_r13004143","pull_request_url":"https://api.github.com/repos/ethz-asl/Schweizer-Messer/pulls/83","_links":{"self":{"href":"https://api.github.com/repos/ethz-asl/Schweizer-Messer/pulls/comments/13004143"},"html":{"href":"https://github.com/ethz-asl/Schweizer-Messer/pull/83#discussion_r13004143"},"pull_request":{"href":"https://api.github.com/repos/ethz-asl/Schweizer-Messer/pulls/83"}}}}