Plot x/y with proper splitting for interrupted projections.
(axes, x, y, delta_cut=1e100, **kwargs)
| 183 | |
| 184 | |
| 185 | def plot_with_interruptions(axes, x, y, delta_cut=1e100, **kwargs): |
| 186 | """Plot x/y with proper splitting for interrupted projections.""" |
| 187 | _x = np.atleast_1d(x) |
| 188 | _y = np.atleast_1d(y) |
| 189 | |
| 190 | dx = np.nan_to_num(_x[1:]) - np.nan_to_num(_x[0:-1]) |
| 191 | dy = np.nan_to_num(_y[1:]) - np.nan_to_num(_y[0:-1]) |
| 192 | (split,) = ((np.abs(dx) > delta_cut) | (np.abs(dy) > delta_cut)).nonzero() |
| 193 | split = np.append(split, _x.size - 1) |
| 194 | split += 1 |
| 195 | |
| 196 | last_part = 0 |
| 197 | for part in split: |
| 198 | axes.plot(x[last_part:part], y[last_part:part], **kwargs) |
| 199 | last_part = part |
| 200 | |
| 201 | |
| 202 | def plotproj(plotdef, geoms, outdir): |