File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
pyneuroml/neuron/analysis Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 33.SH NAME
44pynml-modchananalysis \- manual page for pynml-modchananalysis v1.2.8
55.SH DESCRIPTION
6- usage: pynml\- modchananalysis [\- h] [\- v] [\- nogui] [\- minV <min v>]
6+ usage: pynml\- modchananalysis [\- h] [\- v] [\- nogui] [\- savePlots] [ \- minV <min v>]
77.TP
88[\- maxV <max v>] [\- stepV <step v>]
99[\- dt <time step>] [\- duration <duration>]
@@ -30,6 +30,9 @@ Verbose output
3030\fB \- nogui \fR
3131Supress plotting of variables and only save to file
3232.TP
33+ \fB \- savePlots \fR
34+ Export image (.png) of plotted figures to device
35+ .TP
3336\fB \- minV \fR <min v>
3437Minimum voltage to test (integer, mV)
3538.TP
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ def process_args():
4444 help = "Supress plotting of variables and only save to file" ,
4545 )
4646
47+ parser .add_argument (
48+ "-savePlots" ,
49+ action = "store_true" ,
50+ default = False ,
51+ help = "Export image (.png) of plotted figures to device" ,
52+ )
53+
4754 parser .add_argument (
4855 "-minV" ,
4956 type = int ,
@@ -535,6 +542,16 @@ def main():
535542 file .close ()
536543 print ("Written info to file: %s" % file_name )
537544
545+ if args .savePlots :
546+ figs = pylab .get_fignums ()
547+
548+ for fig in figs :
549+ pylab .figure (fig )
550+ window_title = pylab .get_current_fig_manager ().get_window_title ()
551+ file_name = f"{ window_title } .png"
552+ plt .savefig (file_name )
553+ print ("Exported img to file: %s" % file_name )
554+
538555 if not args .nogui :
539556 pylab .show ()
540557
You can’t perform that action at this time.
0 commit comments