Skip to content

Commit

Permalink
Fixed a plotting bug for prior polygons
Browse files Browse the repository at this point in the history
  • Loading branch information
VPetukhov committed Sep 13, 2024
1 parent e3d5e2e commit ff7a78e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/reporting/diagnostic_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function plot_dataset_colors(
fig[1, 1] = MK.Axis(fig; xticksvisible=ticks, yticksvisible=ticks, axis_kwargs...);

if length(prior_polygons) > 0
MK.poly!([MK.Point2.(eachrow(p)) for p in prior_polygons]; strokecolor="darkred", color=Colors.RGBA(1, 0.65, 0, 0.25), strokewidth=0.5)
MK.poly!([MK.Point2.(eachrow(p)) for p in prior_polygons if Base.size(p, 1) > 1]; strokecolor="darkred", color=Colors.RGBA(1, 0.65, 0, 0.25), strokewidth=0.5)
end

return plot_molecules!(df_spatial, polygons; color=color, markersize=markersize, alpha=alpha, kwargs...)
Expand Down
2 changes: 1 addition & 1 deletion src/reporting/plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function plot_molecules(
end

if length(polygons) > 0
MK.poly!([MK.Point2.(eachrow(p .+ [offset[1] offset[2]])) for p in polygons if Base.size(p, 1) > 0]; polygon_kwargs...)
MK.poly!([MK.Point2.(eachrow(p .+ [offset[1] offset[2]])) for p in polygons if Base.size(p, 1) > 1]; polygon_kwargs...)
# We can also do `for p in polygons MK.lines!(p[:,1], p[:,2], color="black") end`, but this is 10+ times slower
end

Expand Down

0 comments on commit ff7a78e

Please sign in to comment.