Keep list of figures or plots and flip through list using UI

Sorry this didn’t get a response for so long.

The core of the embedding in Qt is at QWidget which contains the canvas. Anything you want to do with a QWidget you can do with the canvas. Independently you need to maintain the mpl level plotting objects (the Figure, Axes, and Artist objects) (well, you don’t need to, you can get to them through the canvas object, but to keep your self sane I highly recommend keeping track of the mpl objects your self, this linkage is there so that GUI generated draw commands can trigger a re-rendering of the figure).

I would just have a widget for each of the plots you want to have and then cycle which one is visible in the main window, that is probably a lot easier than trying to attach and detach canvases from Figures.

I would also take a look at glue http://www.glueviz.org/en/stable/installation.html who may have solved many of these problems for you.

Tom

···

On Thu Feb 05 2015 at 1:03:16 PM tenspd137 . <dcday137@…287…> wrote:

Hi all,

I often have scripts that make a lot of plots, and I would like to be

able to create the plots and then have a UI tool that shows a list of

their titles, click on the title and have the plot be drawn in a

window. So far, I have been able to use PyQt to create a UI with a

list box and a Widget to display plots. What I can’t seem to figure

out is how to make a bunch of plots and then have the Window update.

So, in psuedo code:

list of plots = []

Go through datasets:

    plots.append(plot(dataset))

For plot in plots:

   add plot title to UI list, position in list is reference back

into list of plots

On UI:

    click on plot name/title

    widget draws plot

So - basically like docked plots, except there is just a list to the

side instead (much cleaner IMHO)

I haven’t been able to find any examples from googling. Has any one

been able to do this or seen examples?

Any help or suggestions are appreciated!

Thanks!

:


Dive into the World of Parallel Programming. The Go Parallel Website,

sponsored by Intel and developed in partnership with Slashdot Media, is your

hub for all things parallel software development, from weekly thought

leadership blogs to news, videos, case studies, tutorials and more. Take a

look and join the conversation now. http://goparallel.sourceforge.net/


Matplotlib-users mailing list

Matplotlib-users@…1735…sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users