diff --git a/news/1986.misc b/news/1986.misc index 25843621b6..19254d66ca 100644 --- a/news/1986.misc +++ b/news/1986.misc @@ -1 +1 @@ -Minor improvements to plot_network_and_parcels to allow straightforward compatability with imshowgrid. \ No newline at end of file +Minor improvements to plot_network_and_parcels to allow straightforward compatability with imshowgrid. diff --git a/src/landlab/plot/network_sediment_transporter/plot_network_and_parcels.py b/src/landlab/plot/network_sediment_transporter/plot_network_and_parcels.py index eb64b80f52..7cd38d564e 100644 --- a/src/landlab/plot/network_sediment_transporter/plot_network_and_parcels.py +++ b/src/landlab/plot/network_sediment_transporter/plot_network_and_parcels.py @@ -232,8 +232,8 @@ def plot_network_and_parcels( fig = plt.figure(**kwargs) else: # we'll be adding this plot to existing axes - fresh_fig = False - + fresh_fig = False + spec = gridspec.GridSpec( ncols=1, nrows=3, @@ -244,13 +244,13 @@ def plot_network_and_parcels( figure=fig, height_ratios=[1, 0.1, 0.2], ) - + if fresh_fig == True: ax = fig.add_subplot(spec[0, 0]) - else: + else: plt.figure(fig) ax = plt.gca() - ax.set_subplotspec(spec[0, 0]) + ax.set_subplotspec(spec[0, 0]) if n_legends > 0: label_spec = spec[1, 0].subgridspec( @@ -478,7 +478,7 @@ def plot_network_and_parcels( if output is not None: if type(output) is str: - plt.savefig(output, bbox_inches='tight') + plt.savefig(output, bbox_inches="tight") plt.clf() elif output: plt.show()