This script uses the wxpython library to create a matplotlib graph along side a listbox chooser so that graphs can be added or removed from the graph. This is very useful for cases where there are many similar plots to compare and explore.

To use this script as a plotting module simply import the class DataExplorer and use as follows

    data = {}
    data[(a,b,c)] = xdata,ydata
    data[(d,e,f)] = xdata2,ydata2

    app = DataExplorer(data,redirect=False) #initialise
    app.MainLoop() # run

where data is a dictionary of data with each entry key is a tuple or string and each value is a tuple of x and y arrays
ie. {'text to display in chooser':(x_array,y_array)}. Alternatively, each key can be a tuple in which case the chooser will
be multiple columned and sortable ie. {('label1','label2',float,int):(x_array,y_array)}. But if you are using tuples for keys
then all must be the same length!

There are some additional features of the script such as being able to save the displayed data to a csv file and turning a legend on and off. Normal matplotlib shortcut keys should also work when the graph is in focus i.e. pressing 'k' when using the plot should make the xaxis logarythmic. 'g' should create a grid.



  • data: A dictionary with tuple keys (all with the same length) or simple string keys. The values are a tuple of the x and y data arrays to plot (x,y).
  • labels: A tuple which must contain (xlabel,ylabel,columnhdr). Columnhdr will be a tuple of entries that describes your entry fields for the data dictionary's keys and is used to label the columns of the checkbox list.
  • styles: A dictionary that can override the default style of a plot if you add an entry with the appropriate key.
  • fits: A dictionary of functions of one variable which must be the xaxis. If there is an entry in this dictionary for a given plot's key then this function will be plotted along with the original data.
  • title: Sets text of window title bar.


The script can be installed from pypi using pip or manually from the bitbucket repository. Either install in the site-packages directory or directly in your project directory since it is only a single file. The script runs on python 2.5-2.7 and requires wxpython and matplotlib to be installed.


If there are any problems can you please create an issue on the bitbucket issue tracker.