Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions docs/examples/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from flopy4.mf6.simulation import Simulation
from flopy4.mf6.tdis import Tdis

ws = Path("./quickstart_data")
ws = Path(__file__).parent / "quickstart_data"
name = "mymodel"
tdis = Tdis()
ims = Ims()
Expand Down Expand Up @@ -41,24 +41,21 @@
assert oc.data["save_head"][0] == "all"
assert oc.data.save_head.sel(per=0) == "all"

# PLOT

# set specific discharge
spdis = gwf.output.budget
heads = gwf.output.head
sq = heads.squeeze()
# get head and budget results
budget = gwf.output.budget.squeeze()
head = gwf.output.head.squeeze()

# make plot
fig, ax = plt.subplots()
ax.tick_params()
ax.set_xticks(np.arange(0, 11, 2), minor=False)
ax.set_xticks(np.arange(1, 10, 2), minor=True)
ax.set_yticks(np.arange(0, 11, 2), minor=False)
ax.set_yticks(np.arange(1, 10, 2), minor=True)
ax.grid(which="both", color="white")
sq.plot.imshow(ax=ax)
sq.plot.contour(ax=ax, levels=[0.2, 0.4, 0.6, 0.8], linewidths=3.0)
spdis.squeeze().plot.quiver(
head.plot.imshow(ax=ax)
head.plot.contour(ax=ax, levels=[0.2, 0.4, 0.6, 0.8], linewidths=3.0)
budget.plot.quiver(
x="x", y="y", u="npf-qx", v="npf-qy", ax=ax, color="white"
)
qs_pth = Path("./image/quickstart.png")
fig.savefig(qs_pth)
fig.savefig(ws / "quickstart.png")
Loading
Loading