Skip to content

Commit

Permalink
pyplot: check for existence of cnt.collections before access
Browse files Browse the repository at this point in the history
(probably some newer matplotlib is different, visual
impression seemingly not affected)
  • Loading branch information
j-fu committed Jan 20, 2025
1 parent f3aad2a commit ad02130
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pyplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,12 @@ function scalarplot!(ctx, TP::Type{PyPlotType}, ::Type{Val{2}}, grids, parentgri
cmap = PyPlot.ColorMap(plaincolormap(ctx)),
)

for c in cnt.collections
c.set_edgecolor("face")
if hasproperty(cnt,:collections)
for c in cnt.collections
c.set_edgecolor("face")
end
end

ax.tricontour(tdat..., func; colors = "k", levels = levels)

if ctx[:colorbar] == :horizontal
Expand Down

0 comments on commit ad02130

Please sign in to comment.