Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Fixed labels for scatter plots. Set correct labels in go_workflow. Removed extra loadings plot.

This commit is contained in:
Truls Alexander Tangstad 2006-04-27 11:38:40 +00:00
parent 60c1d19a74
commit 3683f6c2e9
2 changed files with 8 additions and 6 deletions

View File

@ -399,8 +399,8 @@ class LinePlot(Plot):
class ScatterPlot(Plot): class ScatterPlot(Plot):
def __init__(self, dataset,id_dim, sel_dim,id_1,id_2): def __init__(self, dataset, id_dim, sel_dim, id_1, id_2, name="Scatter plot"):
Plot.__init__(self, 'Scatter plot') Plot.__init__(self, name)
fig = Figure(figsize=(5,4), dpi=72) fig = Figure(figsize=(5,4), dpi=72)
self.ax = ax = fig.add_subplot(111) self.ax = ax = fig.add_subplot(111)
self.current_dim = id_dim self.current_dim = id_dim
@ -412,6 +412,9 @@ class ScatterPlot(Plot):
self.xaxis_data = dataset._array[:,x_index] self.xaxis_data = dataset._array[:,x_index]
self.yaxis_data = dataset._array[:,y_index] self.yaxis_data = dataset._array[:,y_index]
ax.plot(self.xaxis_data,self.yaxis_data,'og') ax.plot(self.xaxis_data,self.yaxis_data,'og')
ax.set_title(self.get_title())
ax.set_xlabel("%s - %s" % (sel_dim, id_1))
ax.set_ylabel("%s - %s" % (sel_dim, id_2))
### ###

View File

@ -250,8 +250,7 @@ class PCAFunction(workflow.Function):
# cleanup # cleanup
rpy.r.rm(["t", "m"]) rpy.r.rm(["t", "m"])
loading_plot1 = plots.ScatterPlot(P,'ids','component','1','2') loading_plot = plots.ScatterPlot(P,'ids','component','1','2', "Loadings")
loading_plot2 = plots.ScatterPlot(P,'ids','component','3','4') score_plot = plots.ScatterPlot(T,'filename','component','1','2', "Scores")
score_plot = plots.ScatterPlot(T,'filename','component','1','2')
return [T, P, loading_plot1, loading_plot2, score_plot] return [T, P, loading_plot, score_plot]