Mapview visualizations using FloPy

71 views
Skip to first unread message

Gonzalo Eduardo Parada

unread,
May 27, 2025, 1:07:15 AMMay 27
to MODFLOW Users Group
Hi Everyone,

I currently have MF Usg model with Voronoi grid. I would like to generate some mapviews with some of their properties. 

I wrote this code, just to check the grid:

ml = flopy.mfusg.MfUsg.load("MN_Integrado_PC.nam") 
fig, ax = plt.subplots(figsize=(12, 10))

# Create the plot map view with additional parameters
pmv = flopy.plot.PlotMapView(model=ml, layer=0)  # Plot first layer

# Plot the grid with additional parameters
pmv.plot_grid(colors='black', alpha=0.5)
pmv.plot_bc(name='WEL', color='red')  # Plot wells in red

# Add a title
plt.title('MODFLOW-USG Grid and Wells')

# Show the plot
plt.show()


But it doesnt seems to work. Is there a way to directly work with the DIS obtained from the USG packages?

Best regards. 

Oscar Fabian Sanchez Ortiz

unread,
May 27, 2025, 2:08:44 AMMay 27
to MODFLOW Users Group
Do you have the grid specification file?
This script shows roughly how to plot mf-usg models with the GSF file
https://github.com/modflowpy/flopy/blob/develop/.docs/Notebooks/mfusg_freyberg_example.py
Cheers

Oscar Fabian Sanchez Ortiz

unread,
May 27, 2025, 2:08:51 AMMay 27
to mod...@googlegroups.com
Do you have the grid specification file?
In this script, it shows roghly how to plot mf-usg models with the GSF file
https://github.com/modflowpy/flopy/blob/develop/.docs/Notebooks/mfusg_freyberg_example.py
Cheers

--
This group was created in 2004 by Mr. C. P. Kumar, Former Scientist 'G', National Institute of Hydrology, Roorkee. Please visit his webpage at https://www.angelfire.com/nh/cpkumar/
---
You received this message because you are subscribed to the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modflow+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/modflow/6eecced5-8655-480f-b631-67f1b8d7ff63n%40googlegroups.com.

Gonzalo Eduardo Parada

unread,
May 27, 2025, 10:09:46 AMMay 27
to MODFLOW Users Group
Thanks, it worked.

Do you know why when I try to plot cross sections I don't obtain "clean" sections? For some reason there are some kind of "intermediate" nodes, even though my model only has 15 layers. 

Oscar Fabian Sanchez Ortiz

unread,
May 30, 2025, 12:06:44 AMMay 30
to MODFLOW Users Group

Awesome, to be honest, I have no idea what could be happening there, Flopy and MF-Usg sometimes don't get along too well, especially for versions higher than 1.5
In this more friendly version of the script I shared, it seems to be normal. Can you share an image?
MODFLOW-USG Freyberg demo — FloPy 3.10.0.dev3 documentation
Reply all
Reply to author
Forward
0 new messages