You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: plot_ibound method not working, grid is not shown #2592
Do you have any more information? The plot_ibound method has not been changed/updated in a long time and has been fairly reliable. A minimal example would help in determining what the issue you are having is.
Thank you for your suggestion, Joshua.
I agree that plot_ibound has been reliable, as I have never had any issue
with it until now. This is a 2D, MF6, 1-layer model with all cells as
active. I don't see anything wrong with my lines of code:
fig, ax = plt.subplots(1, 1, figsize=(10, 8))
# fig.suptitle('',fontsize=18)
mv = flopy.plot.PlotMapView(model=gwf, layer=0, ax=ax)
for level, color in zip(levels, rgba):
mv.contour_array(mf6_conc, levels=[level], colors=color, linewidths=2.0,
alpha=1., linestyles='solid')
mv.contour_array(pht3d_conc, levels=[level], colors=color,
linewidths=2.0,
alpha=1., linestyles='dashed')
mv.plot_bc('WEL', color='red')
mv.plot_bc('CHD', color='blue')
mv.plot_ibound(alpha=0.8)
plt.show()
ax.set_title(f'Toluene concentrations after {day} days',fontsize=14)
# ax.set_axis_off()
fig.tight_layout()
That code produces:
[image: image.png]
See there is no grid. But your suggestion works:
fig, ax = plt.subplots(1, 1, figsize=(10, 8))
# fig.suptitle('',fontsize=18)
mv = flopy.plot.PlotMapView(model=gwf, layer=0, ax=ax)
mv.plot_grid(alpha=0.5)
for level, color in zip(levels, rgba):
mv.contour_array(mf6_conc, levels=[level], colors=color, linewidths=2.0,
alpha=1., linestyles='solid')
mv.contour_array(pht3d_conc, levels=[level], colors=color,
linewidths=2.0,
alpha=1., linestyles='dashed')
mv.plot_bc('WEL', color='red')
mv.plot_bc('CHD', color='blue')
# mv.plot_ibound(alpha=0.8)
plt.show()
ax.set_title(f'Toluene concentrations after {day} days',fontsize=14)
# ax.set_axis_off()
fig.tight_layout()
[image: image.png]
Thanks,
Andres
@aestrad-interaplot_ibound() masks out the active cells and plots inactive cells as black and vertical pass through cells as red. The reason you're not seeing anything when you use plot_ibound(), is that all cells in your model are active which means that by the default behavior they are masked (which is the behavior that we expect).
Activity
jlarsen-usgs commentedon Sep 5, 2025
@aestrad-intera
Do you have any more information? The
plot_iboundmethod has not been changed/updated in a long time and has been fairly reliable. A minimal example would help in determining what the issue you are having is.jlarsen-usgs commentedon Sep 5, 2025
Also to plot the grid, call:
aestrad-intera commentedon Sep 6, 2025
wpbonelli commentedon Sep 24, 2025
@aestrad-intera could you provide the model you are using with this plotting code, or a simple one reproducing the issue?
jlarsen-usgs commentedon Sep 24, 2025
@aestrad-intera
plot_ibound()masks out the active cells and plots inactive cells as black and vertical pass through cells as red. The reason you're not seeing anything when you useplot_ibound(), is that all cells in your model are active which means that by the default behavior they are masked (which is the behavior that we expect).