matplotlib

matplotlibで動的に描画する時はdraw_idle

matplotlibで動的に描画する時はdraw_idleを使おう。 draw_idle(*args, **kwargs)[source] Request a widget redraw once control returns to the GUI event loop. Even if multiple calls to draw_idle occur before control returns to the GUI event loop…

wxpythonのMatplotlibにラバーバンドを表示する

wxpythonでmatplotlibの表示(高速化) - メグタンの何でもブログ の続き マウスでラバーバンドを表示してmatplotlibの領域を選択したい時 matplotlibにはRectangleSelectorがあるのでそれを利用すると良い。 from matplotlib.widgets import RectangleSelect…

wxpythonでmatplotlibの表示(高速化)

wxpythonでmatplotlibのクリック座標取得 - メグタンの何でもブログ の続き Matplotlibの表示データが多い時に表示の負荷を減らす方法 import matplotlib as mpl mpl.rcParams['path.simplify_threshold'] = 1.0 デフォルトでは1/9が設定されている。 値は0.…

wxpythonでmatplotlibのクリック座標取得

wxpythonでmatplotlibのポイント座標取得 - メグタンの何でもブログ の続き wxpythonでmatplotlibのイベント処理 Matplotlibのイベントには次のようなものがある。 Event name class Description 'button_press_event' MouseEvent mouse button is pressed '…

wxpythonでmatplotlibのポイント座標取得

wxPythonで3Dチャートを表示 - メグタンの何でもブログ の続き wxpythonのデスクトップアプリ上に表示したmatplotlibグラフの座標読み取り pick_eventを設定 self.fig, self.ax = plt.subplots() self.fig.canvas.mpl_connect('pick_event', self.on_pick) …

wxPythonで3Dチャートを表示

wxPythonでMatplotlibを使う - メグタンの何でもブログ の続き Matplotlibで3Dグラフ表示 3Dのグラフを描画する時には 次の様に変える。 self.fig, self.ax = plt.subplots(subplot_kw={"projection": "3d"}) 表示データは例えばこんな感じ def SampleData…

wxPythonでMatplotlibを使う

wxFormBuilderでデスクトップアプリ作成の基礎 - メグタンの何でもブログの続き 起動用mainファイル main.py # -*- coding: utf-8 -*- import wx import win32gui import ctypes import o3dMain class MyApp(wx.App): def OnInit(self): frame = o3dMain.o3d…