From aeec6bed95a9aac502b79a02b44a45874137e5eb Mon Sep 17 00:00:00 2001 From: Firas Date: Thu, 7 Mar 2024 16:38:40 -0700 Subject: [PATCH 1/2] Fixed colormap not updating in overlay plots --- src/Recipes/SeisOverlayRecipe.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Recipes/SeisOverlayRecipe.jl b/src/Recipes/SeisOverlayRecipe.jl index bb865d1..ad6f5a7 100644 --- a/src/Recipes/SeisOverlayRecipe.jl +++ b/src/Recipes/SeisOverlayRecipe.jl @@ -63,7 +63,7 @@ function Makie.plot!(overlay::SeisOverlay{<:Tuple{AbstractMatrix{<:Real}}}) seisimage!(overlay, overlay.d[], ox=overlay.ox[], dx=overlay.dx[], oy=overlay.oy[], dy=overlay.dy[], - colormap=overlay.cmap[], + cmap=overlay.cmap[], vmin=overlay.vmin[], vmax=overlay.vmax[], pclip=overlay.pclip[]) From 82138b547e6c5d6b8c3fd3c1047b3f3f44f195fb Mon Sep 17 00:00:00 2001 From: Firas Date: Thu, 7 Mar 2024 16:51:49 -0700 Subject: [PATCH 2/2] Clipped off negative values of first wiggle in overlay plot --- src/Recipes/SeisOverlayRecipe.jl | 8 ++++++-- src/SeisPlotTX.jl | 9 ++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Recipes/SeisOverlayRecipe.jl b/src/Recipes/SeisOverlayRecipe.jl index ad6f5a7..83808a7 100644 --- a/src/Recipes/SeisOverlayRecipe.jl +++ b/src/Recipes/SeisOverlayRecipe.jl @@ -61,13 +61,17 @@ end function Makie.plot!(overlay::SeisOverlay{<:Tuple{AbstractMatrix{<:Real}}}) - seisimage!(overlay, overlay.d[], ox=overlay.ox[], dx=overlay.dx[], oy=overlay.oy[], + # Clipping the negative values of the first wiggle + clipped_d = copy(overlay.d[]) + clipped_d[:, 1] = max.(clipped_d[:, 1], 0) + + seisimage!(overlay, clipped_d, ox=overlay.ox[], dx=overlay.dx[], oy=overlay.oy[], dy=overlay.dy[], cmap=overlay.cmap[], vmin=overlay.vmin[], vmax=overlay.vmax[], pclip=overlay.pclip[]) - seiswiggle!(overlay, overlay.d[], ox=overlay.ox[], dx=overlay.dx[], oy=overlay.oy[], + seiswiggle!(overlay, clipped_d, ox=overlay.ox[], dx=overlay.dx[], oy=overlay.oy[], dy=overlay.dy[], xcur=overlay.xcur[], wiggle_trace_increment=overlay.wiggle_trace_increment[], diff --git a/src/SeisPlotTX.jl b/src/SeisPlotTX.jl index b5caccd..9ae06e1 100644 --- a/src/SeisPlotTX.jl +++ b/src/SeisPlotTX.jl @@ -59,6 +59,9 @@ function SeisPlotTX(d; trace_width=trace_width, cmap=cmap) Colorbar(fig[1, 2], overlay) + + xlims!(ax, low=ox, high=ox+size(d,2)*dx) + elseif style == "wiggles" || style == "wiggle" if !isnothing(gx) ox = gx[1] @@ -70,12 +73,16 @@ function SeisPlotTX(d; wiggle_line_color=wiggle_line_color, wiggle_fill_color=wiggle_fill_color, trace_width=trace_width) + + xlims!(ax, low=ox-dx, high=ox+size(d,2)*dx) + else img = seisimage!(ax, d; ox=ox, dx=dx, oy=oy, dy=dy, pclip=pclip, vmin=vmin, vmax=vmax, cmap=cmap) Colorbar(fig[1,2], img) + + xlims!(ax, low=ox, high=ox+size(d,2)*dx) end - xlims!(ax, low=ox-dx, high=ox+size(d,2)*dx) return fig, ax end