From 92eb9bb0b1cb5253eb5e1dc08f274e44d04cf302 Mon Sep 17 00:00:00 2001 From: William Thompson Date: Wed, 20 Nov 2024 09:54:01 -0800 Subject: [PATCH] Fix bug with auto limits in RV plot by forcing default ylims --- ext/OctofitterMakieExt/rvtimeplot.jl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ext/OctofitterMakieExt/rvtimeplot.jl b/ext/OctofitterMakieExt/rvtimeplot.jl index 841653aa..f7caea39 100644 --- a/ext/OctofitterMakieExt/rvtimeplot.jl +++ b/ext/OctofitterMakieExt/rvtimeplot.jl @@ -83,10 +83,10 @@ function rvtimeplot!( ) end + y_ax_limits = (0,0) # CASE: no data, just plot model. if isempty(like_objs) - @info "is empyty" ax = Axis( gs[1, 1]; ylabel= use_kms ? "rv [km/s]" : "rv [m/s]", @@ -149,11 +149,14 @@ function rvtimeplot!( color = concat_with_nan(color_model_t), colorrange=(0,2pi), colormap, - label="A", rasterize=4, ) + y_ax_limits = extrema([y_ax_limits...; filter(isfinite, concat_with_nan(rv_star_model_t) .* kms_mult)]) + end + + # CASE: one or more RV likelihood objects. # The only safe way to display these is with a separate panel per instrument gs_row = 0 @@ -315,7 +318,6 @@ function rvtimeplot!( color = concat_with_nan(color_model_t), colorrange=(0,2pi), colormap, - label="A", rasterize=4, ) @@ -340,8 +342,11 @@ function rvtimeplot!( strokecolor=:black, markersize=8, #1.5, ) + y_ax_limits = extrema([y_ax_limits...; filter(isfinite, concat_with_nan(rv_star_model_t) .* kms_mult); rv_data .* kms_mult]) end + ylims!(ax, y_ax_limits...) + if colorbar Colorbar( gs[1,2];