From 0568be834ecce243f727668efca4384d486f5e5f Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Wed, 21 Aug 2019 13:56:19 +1000 Subject: [PATCH] Remove empty space on left side of profile plots --- las_outputs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/las_outputs.py b/las_outputs.py index 120db6a..53c89f7 100644 --- a/las_outputs.py +++ b/las_outputs.py @@ -115,7 +115,13 @@ def plot_profiles(profile_name, csv_output_dir, graph_loc, ch_limits, delta_vol, if Ylim<10: ax.set_ylim([ax.get_ylim()[0], 10]) - + + # Remove empty space at left of figure + try: + ax.set_xlim(left=profile.first_valid_index() - 10) + except TypeError: + pass + # Show most recent volume change if delta_vol is not None: ax.annotate('Most recent\nvolume change:\n{:+0.1f} m$^3$/m'.format(delta_vol), @@ -235,7 +241,7 @@ def process(yaml_file): print('Cropping swash...') las_data = call_lastools('lasclip', input=input_las, output='-stdout', args=['-poly', crop_swash_poly], verbose=False) - + # Export classified, clipped las for delivery to client las_name = os.path.join(output_las_dir, las_basename + '.las') with open (las_name, 'wb') as f: