Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 14, 2024
1 parent f9c70e1 commit 9d59455
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion news/1986.misc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Minor improvements to plot_network_and_parcels to allow straightforward compatability with imshowgrid.
Minor improvements to plot_network_and_parcels to allow straightforward compatability with imshowgrid.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 9d59455

Please sign in to comment.