Skip to content

Commit afb1ee5

Browse files
committed
Draw contour lines on Valley-Bowl backgrounds
1 parent b02cf21 commit afb1ee5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎tests/trajectories/_plotters.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def __call__(self, ax: plt.Axes) -> None:
315315
class FilledContourPlotter(Plotter):
316316
"""
317317
Plotter that draws filled contours of the given values on a regular grid extending between the
318-
provided coordinates.
318+
provided coordinates, with thin contour lines at the boundaries between levels.
319319
320320
:param values: Array of shape ``[n_x, n_y]``, where ``values[i, j]`` is the value at the i-th x
321321
coordinate and the j-th y coordinate.
@@ -354,6 +354,11 @@ def __call__(self, ax: plt.Axes) -> None:
354354
ax.contourf(
355355
xs, ys, self.values.T, levels=self.levels, cmap=self.cmap, alpha=self.alpha, zorder=0
356356
)
357+
# Draw the level boundaries explicitly, since vector outputs (e.g. PDF) render adjacent
358+
# filled levels without any visible seam.
359+
ax.contour(
360+
xs, ys, self.values.T, levels=self.levels, cmap=self.cmap, linewidths=0.3, zorder=0
361+
)
357362

358363

359364
class LimAdjuster(Plotter):

0 commit comments

Comments
 (0)