Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Updated to handle new numpy/scipy.

This commit is contained in:
Einar Ryeng 2007-07-24 12:19:13 +00:00
parent 05274b4f0b
commit 524c90fcf7
1 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@ from matplotlib.mlab import prctile
from matplotlib.colors import ColorConverter from matplotlib.colors import ColorConverter
import networkx import networkx
import scipy import scipy
from numpy import matlib
import fluents import fluents
import logger import logger
@ -692,7 +693,7 @@ class NetworkPlot(Plot):
ax=self.axes, ax=self.axes,
edge_color=edge_color) edge_color=edge_color)
# edge color rgba-arrays # edge color rgba-arrays
self._edge_color_rgba = scipy.repmat(ColorConverter().to_rgba(edge_color), self._edge_color_rgba = matlib.repmat(ColorConverter().to_rgba(edge_color),
self.graph.number_of_edges(),1) self.graph.number_of_edges(),1)
self._edge_color_selected = ColorConverter().to_rgba(self.default_props['edge_color_selected']) self._edge_color_selected = ColorConverter().to_rgba(self.default_props['edge_color_selected'])
if self._with_labels: if self._with_labels:
@ -736,7 +737,7 @@ class NetworkPlot(Plot):
edge_color_rgba = self._edge_color_rgba.copy() edge_color_rgba = self._edge_color_rgba.copy()
index = self.get_index_from_selection(self.dataset, selection) index = self.get_index_from_selection(self.dataset, selection)
if len(index) > 0: if len(index) > 0:
linewidth.put(2, index) linewidth[index] = 2
idents = selection[self.current_dim] idents = selection[self.current_dim]
edge_index = [i for i,edge in enumerate(self.graph.edges()) if (edge[0] in idents and edge[1] in idents)] edge_index = [i for i,edge in enumerate(self.graph.edges()) if (edge[0] in idents and edge[1] in idents)]
if len(edge_index)>0: if len(edge_index)>0: