diff --git a/system/plots.py b/system/plots.py index 53607ac..d466ca4 100644 --- a/system/plots.py +++ b/system/plots.py @@ -399,8 +399,8 @@ class LinePlot(Plot): class ScatterPlot(Plot): - def __init__(self, dataset,id_dim, sel_dim,id_1,id_2): - Plot.__init__(self, 'Scatter plot') + def __init__(self, dataset, id_dim, sel_dim, id_1, id_2, name="Scatter plot"): + Plot.__init__(self, name) fig = Figure(figsize=(5,4), dpi=72) self.ax = ax = fig.add_subplot(111) self.current_dim = id_dim @@ -412,6 +412,9 @@ class ScatterPlot(Plot): self.xaxis_data = dataset._array[:,x_index] self.yaxis_data = dataset._array[:,y_index] 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)) ### diff --git a/workflows/go_workflow.py b/workflows/go_workflow.py index a3de6f6..8b4bd49 100644 --- a/workflows/go_workflow.py +++ b/workflows/go_workflow.py @@ -250,8 +250,7 @@ class PCAFunction(workflow.Function): # cleanup rpy.r.rm(["t", "m"]) - loading_plot1 = plots.ScatterPlot(P,'ids','component','1','2') - loading_plot2 = plots.ScatterPlot(P,'ids','component','3','4') - score_plot = plots.ScatterPlot(T,'filename','component','1','2') + loading_plot = plots.ScatterPlot(P,'ids','component','1','2', "Loadings") + score_plot = plots.ScatterPlot(T,'filename','component','1','2', "Scores") - return [T, P, loading_plot1, loading_plot2, score_plot] + return [T, P, loading_plot, score_plot]