diff --git a/figures/f1-protocols/f1-protocols.py b/figures/f1-protocols/f1-protocols.py index 21c99ed3c..30d2e7e11 100755 --- a/figures/f1-protocols/f1-protocols.py +++ b/figures/f1-protocols/f1-protocols.py @@ -26,14 +26,16 @@ # base = os.path.splitext(os.path.basename(__file__))[0] args = sys.argv[1:] -if len(args) != 1: - print('Syntax: ' + base + '.py ') +if len(args) not in (1, 2): + print('Syntax: ' + base + '.py (pdf)') sys.exit(1) if args[0] == 'all': cell_list = range(1, 10) else: cell_list = [int(args[0])] +pdf = (len(args) > 1 and args[1] == 'pdf') + # Set font font = {'family': 'arial', 'size': 10} @@ -118,6 +120,8 @@ def mm(*size): # Finalise fig.subplots_adjust(0.055, 0.055, 0.985, 0.98) fig.savefig(base + '-cell-' + str(cell) + '.png') + if pdf: + fig.savefig(base + '-cell-' + str(cell) + '.pdf') #plt.show() diff --git a/figures/f6-cross-validation-3/f6-cross-validation-3.py b/figures/f6-cross-validation-3/f6-cross-validation-3.py index c613e78d3..97f61eda5 100755 --- a/figures/f6-cross-validation-3/f6-cross-validation-3.py +++ b/figures/f6-cross-validation-3/f6-cross-validation-3.py @@ -29,14 +29,15 @@ # base = os.path.splitext(os.path.basename(__file__))[0] args = sys.argv[1:] -if len(args) != 1: - print('Syntax: ' + base + '.py ') +if len(args) not in (1, 2): + print('Syntax: ' + base + '.py (pdf)') sys.exit(1) if args[0] == 'all': cell_list = range(1, 10) else: cell_list = [int(args[0])] +pdf = (len(args) > 1 and args[1] == 'pdf') # Set font @@ -233,6 +234,8 @@ def mm(*size): # Finalise fig.savefig(base + '-cell-' + str(cell) + '.png') + if pdf: + fig.savefig(base + '-cell-' + str(cell) + '.pdf') plt.close(fig) del(fig, ax, grid1, grid2)