Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Added line plot of matrices.

This commit is contained in:
Einar Ryeng 2007-11-08 11:47:36 +00:00
parent 7ee7f0cf7e
commit c26999e688
2 changed files with 30 additions and 0 deletions

View File

@ -240,6 +240,11 @@ class NavigatorMenu(gtk.Menu):
self.plot_menu.append(self.plot_scatter_item)
self.plot_scatter_item.show()
self.plot_line_item = gtk.MenuItem('Line view')
self.plot_line_item.connect('activate', self.on_plot_line, navigator)
self.plot_menu.append(self.plot_line_item)
self.plot_line_item.show()
self.plot_item = gtk.MenuItem('Plot')
self.append(self.plot_item)
self.plot_item.set_submenu(self.plot_menu)
@ -334,6 +339,17 @@ class NavigatorMenu(gtk.Menu):
plot.set_selection_listener(project.set_selection)
project._selection_observers.append(plot)
def on_plot_line(self, item, navigator):
project = main.project
ds = self.dataset
dims = ds.get_dim_name()
ids = ds.get_identifiers(dims[1])
plot = plots.LineViewPlot(ds, name='Line (%s)' % ds.get_name())
icon = fluents.icon_factory.get("line_plot")
project.data_tree_insert(self.tree_iter, 'Line view', plot, None, "black", icon)
plot.set_selection_listener(project.set_selection)
project._selection_observers.append(plot)
def on_transpose(self, item, navigator):
project = main.project
ds = self.dataset.transpose()

View File

@ -1135,6 +1135,20 @@ class PlotThresholder:
self.set_threshold(min, max)
#class PlotContextMenu(gtk.Menu):
# def __init__(self, plot):
# gtk.Menu(self)
# self._plot = plot
#
# # Populate main menu
## self.color_item = gtk.MenuItem('Color')
# self.append(self.color_item)
# self.color_item.set_submenu(self.build_dataset_menu()):
#
# def build_dataset_menu(self):
# return gtk.Menu()
# Create zoom-changed signal
gobject.signal_new('zoom-changed', Plot, gobject.SIGNAL_RUN_LAST, None,
(gobject.TYPE_PYOBJECT,))