41 lines
1.5 KiB
Python
Executable File
41 lines
1.5 KiB
Python
Executable File
#===============================================================================
|
|
# Copyright (C) 2010 Diego Duclos
|
|
#
|
|
# This file is part of pyfa.
|
|
#
|
|
# pyfa is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# pyfa is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
|
#===============================================================================
|
|
|
|
import wx
|
|
try:
|
|
import matplotlib as mpl
|
|
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas
|
|
except:
|
|
print "problems importing matplotlib, continueing without graphs"
|
|
|
|
class GraphFrame(wx.Frame):
|
|
def __init__(self, parent):
|
|
wx.Frame.__init__(self, parent)
|
|
self.mainSizer = wx.BoxSizer(wx.VERTICAL)
|
|
self.SetSizer(self.mainSizer)
|
|
|
|
self.graphSelection = wx.Choice(self, wx.ID_ANY, style=0)
|
|
self.mainSizer.Add(self.graphSelection, 0, wx.EXPAND)
|
|
|
|
self.figure = mpl.figure.Figure(figsize=(4,2))
|
|
self.canvas = Canvas(self, -1, self.figure)
|
|
|
|
self.mainSizer.Add(self.canvas, 0, wx.EXPAND)
|
|
|