From f662ab6f17119c5aea34c34989367d25810da5f5 Mon Sep 17 00:00:00 2001 From: Catherine Beauchemin Date: Thu, 23 May 2024 23:56:26 +0900 Subject: [PATCH] Fixes to phymcmc_plotter - graph file savename now correctly handles separators w os.sep - triangle plot saved to svg format to avoid stripy plot - see corner.py stripy bug: https://github.com/dfm/corner.py/issues/261 --- bin/phymcmc_plotter | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/phymcmc_plotter b/bin/phymcmc_plotter index ea33f9b..3ae56c1 100755 --- a/bin/phymcmc_plotter +++ b/bin/phymcmc_plotter @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (C) 2017-2021 Catherine Beauchemin +# Copyright (C) 2017-2024 Catherine Beauchemin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ # ============================================================================= # import argparse +import os import phymcmc.plot # @@ -49,7 +50,7 @@ def parse_args(): # Parsing arguments args = parser.parse_args() # Path + basename for plot(s) - savename = args.chainfile.split('/')[-1].split('.hdf5')[0] + savename = args.chainfile.split(os.sep)[-1].split('.hdf5')[0] savename = args.savedirectory + '/' + savename # Parse types of plots requested plotsrequested = set(args.type.split(',')) @@ -77,7 +78,7 @@ if {'hist','all'} & plotsrequested: if {'triangle','all'} & plotsrequested: fig = phymcmc.plot.triangle( args.chainfile, nburn=args.nburn ) - fig.savefig(savename+'_triangle.pdf', bbox_inches='tight') + fig.savefig(savename+'_triangle.svg', bbox_inches='tight') if {'square','all'} & plotsrequested: gridfig = phymcmc.plot.square( args.chainfile, nburn=args.nburn )