@@ -80,9 +80,9 @@ def _meshcoords(da, continuous=True):
80
80
C = np .full ((nrow - 1 , ncol - 1 ), np .nan )
81
81
C [:, 0 ::2 ] = data
82
82
else :
83
- _ , ncol = Y .shape
84
- C = np .full ((nrow , ncol - 1 ), np .nan )
85
- C [: , 0 ::2 ] = data
83
+ nrow , ncol = Y .shape
84
+ C = np .full ((nrow - 1 , ncol - 1 ), np .nan )
85
+ C [0 :: 2 , 0 ::2 ] = data
86
86
87
87
return X , Y , C , nodata
88
88
@@ -106,7 +106,7 @@ def _plot_aquitards(aquitards, ax, kwargs_aquitards):
106
106
C_aq = C_aq .astype (np .float64 )
107
107
for j , i in enumerate (range (0 , X_aq .shape [0 ] - 1 , 2 )):
108
108
Y_i = Y_aq [i : i + 2 ]
109
- C_i = C_aq [j ]
109
+ C_i = C_aq [i ]
110
110
C_i [C_i == 0.0 ] = np .nan
111
111
nodata = np .repeat (np .isnan (C_i [0 ::2 ]), 2 )
112
112
Y_i [:, nodata ] = np .nan
@@ -246,7 +246,10 @@ def cross_section(
246
246
fig , ax = plt .subplots ()
247
247
248
248
# Plot raster
249
- X , Y , C , nodata = _meshcoords (da , continuous = True )
249
+ continuous = not (
250
+ da ["top" ].shape == da ["bottom" ].shape
251
+ ) # allow quasi-3d schematisations
252
+ X , Y , C , nodata = _meshcoords (da , continuous = continuous )
250
253
ax1 = ax .pcolormesh (X , Y , C , ** settings_pcmesh )
251
254
# Plot aquitards if applicable
252
255
if aquitards is not None :
0 commit comments