Skip to content

Commit e675046

Browse files
mjrenomjreno
authored andcommitted
fix gridlines
1 parent 5fada7c commit e675046

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

docs/examples/image/qsprj.png

33 KB
Loading

docs/examples/qsplot.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def _pcolormesh(grid, da, ax):
2323

2424
collection = PolyCollection(vertices)
2525
collection.set_array(da.to_numpy().ravel())
26-
# collection._scale_norm(norm, vmin, vmax)
2726
p = ax.add_collection(collection, autolim=False)
2827

2928
xmin, xmax, ymin, ymax = grid.extent
@@ -35,23 +34,24 @@ def _pcolormesh(grid, da, ax):
3534
return p
3635

3736

38-
# open budget file
37+
# create budget reader
3938
bpth = os.path.join(ws, f"{modelname}.bud")
4039
bobj = flopy.utils.CellBudgetFile(bpth, precision="double")
4140

4241
# set specific discharge
4342
spdis = bobj.get_data(text="DATA-SPDIS")[0]
4443

45-
# open head file
44+
# create head reader
4645
hpth = os.path.join(ws, f"{modelname}.hds")
4746
hobj = flopy.utils.HeadFile(hpth, precision="double")
4847

4948
# set heads
5049
heads = hobj.get_alldata()
5150

52-
# open grb file
51+
# create grb reader
5352
grbpth = os.path.join(ws, f"{modelname}.dis.grb")
5453
grbobj = flopy.mf6.utils.MfGrdFile(grbpth)
54+
grid = None
5555

5656
# flow vector component arrays
5757
uflow = None
@@ -94,7 +94,7 @@ def _pcolormesh(grid, da, ax):
9494
cbar = plt.colorbar(label=da.name)
9595
plt.contour(xcrs, ycrs, qz, 4, cmap="viridis")
9696
# plt.contourf(xcrs, ycrs, qz, 5, cmap='viridis', alpha=0.4)
97-
qs_pth = os.path.join(QS_ROOT, "qs.png")
97+
qs_pth = os.path.join(QS_ROOT, "image", "qs.png")
9898
fig.savefig(qs_pth)
9999

100100
# projection example with cartopy
@@ -103,7 +103,9 @@ def _pcolormesh(grid, da, ax):
103103
ax.coastlines()
104104
ax.stock_img()
105105
ax.set_extent([-5, 15, -4, 14], crs=ccrs.PlateCarree())
106-
ax.gridlines(draw_labels=True)
106+
glines = ax.gridlines(draw_labels=True)
107+
glines.top_labels = False
108+
glines.right_labels = False
107109
ax.set_title("Head")
108-
qsprj_pth = os.path.join(QS_ROOT, "qsprj.png")
110+
qsprj_pth = os.path.join(QS_ROOT, "image", "qsprj.png")
109111
fig.savefig(qsprj_pth)

docs/examples/qsprj.png

-35.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)