2009/7/17 Alexander Bruy <volt...@ua.fm>

> Hi, list!
>
> I have a problem with embedding matplotlib in Qt based GUI. I read manual
> and look at
> example "embedding_in_qt4.py". I create GUI with QtDesigner. For matplotlib
> plot I create
> a QWidget. Then in runtime I embed a matplotlib plot im my GUI, into this
> QWidget. Here some code:
>
> from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as
> FigureCanvas
> from matplotlib.figure import Figure
>
> class dlgStatist( QDialog, Ui_dlgStatistics ):
>        def __init__( self, iface ):
>                QDialog.__init__( self )
>                self.iface = iface
>                self.setupUi( self )
>
>                # prepare figure
>                self.figure = Figure()
>                #self.figure.set_figsize_inches( ( 4.3, 4.2 ) )
>                self.axes = self.figure.add_subplot( 111 )
>                self.figure.suptitle( "Frequency distribution", fontsize =
> 12 )
>                self.axes.grid( True )
>                self.canvas = FigureCanvas( self.figure )
>                self.canvas.setParent( self.widgetPlot )
>                .......
>
> All looks fine, but when user change window size, matplotlib plot doesn't
> resized. I try to set
> SizePolicy to matplotlib figure (as explained in example) but this don't
> help.
> Where is my mistake and can anyone give me a little example how to embed
> matplotlib plot
> in GUI created with QtDesigner? I really need resizible plot into Qt
> dialog.
>
>
> Sorry for my bad English, I'm Ukrainian.
>
> Python 2.5.4
> PyQT 4.4.3
> numpy 1.3.0
> matplotlib 0.98.5.3
>

Please post a short, complete, self-contained script demonstrating the
problem.
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to