Skip to content

Commit fdcc29f

Browse files
committed
Added autosave plots instead of interactive.
1 parent 41a1606 commit fdcc29f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

general_plotter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def draw_individual_plots(present_covar, future_covar, rona, marker_name,
5555
plt.show()
5656

5757

58-
def draw_rona_plot(ronas):
58+
def draw_rona_plot(ronas, outpath):
5959
"""
6060
Draws a RONA plot of the Nth most represented covariates.
6161
Plots the RONA+/-Stderr for each of the populations.
@@ -94,4 +94,10 @@ def draw_rona_plot(ronas):
9494

9595
ax.legend(axes, names, loc='center left', bbox_to_anchor=(1, 0.5))
9696

97-
plt.show()
97+
#plt.tight_layout()
98+
plt.gcf().subplots_adjust(bottom=0.18)
99+
plt.gcf().subplots_adjust(right=0.85)
100+
101+
fig.savefig(outpath)
102+
103+
plt.close(fig)

pyRona.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ def argument_parser(args):
238238
io_opts.add_argument("-pij", dest="baypass_pij_file", type=str,
239239
required=True, help="Baypass pij file.")
240240

241+
io_opts.add_argument("-out", dest="outfile", type=str,
242+
required=True, help="Path to where RONA plot should "
243+
"be saved.")
244+
241245
misc_opts.add_argument("-no-plots", dest="plots", action='store_false',
242246
help="Pass this option if you don't want "
243247
"individual regression plots to be drawn.",
@@ -286,7 +290,7 @@ def main(params):
286290
ronas = ronas_filterer(ronas, arg.use_weights, arg.num_covars)
287291

288292
results_summary(ronas, arg.use_weights)
289-
gp.draw_rona_plot(ronas)
293+
gp.draw_rona_plot(ronas, arg.outfile)
290294

291295

292296
if __name__ == "__main__":

0 commit comments

Comments
 (0)