I am writing gtk2 application on python, I need to plot a chart in
separate window and i just use this code

    def matplot_print(self, print_values):
        """\brief print data by matplotlib and shw the figure
        \param print_values [(name - is a string, [(datetime, value)]
- is a list of data to plot)] - list of charts to plot
        """
        fig = plt.figure()
        ax = fig.add_subplot(111)
        names = map(lambda a: a[0], print_values)
        lines  = map(lambda chart: ax.plot_date(map(lambda chd:
chd[0], chart[1]),
                                                map(lambda chy:
chy[1], chart[1]), '-'), print_values)
        plt.figlegend(lines, names, 'upper left')

        majloc = AutoDateLocator()
        majform = AutoDateFormatter(majloc)
        ax.xaxis.set_major_locator(majloc)
        ax.xaxis.set_major_formatter(majform)
        ax.autoscale_view()
        ax.grid(True)
        fig.autofmt_xdate()
        fig.show()

The figure is showing and everything works before closing the window
of figure. It seems that figure call gtk.main_quit() when closing it's
window. How to override this behaviour ?

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to