From 3123f16c2896a0fe7512295efb433cc4f5606cf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Van=C4=9Bk?= Date: Wed, 19 Mar 2025 13:42:50 +0100 Subject: [PATCH] GR: Fix zscale support in surface plots Previously, `zscale` was being set to a Bool value (the result of the set membership check). This caused a crash when querying the `gr_z_log_scales` tuple on the next line, because that array is indexed by symbols like :log10. Given that the lines above assign the actual symbols to `xscale` and `yscale`, it seems likely that `zscale` should behave the same. Fixes: https://github.com/JuliaPlots/Plots.jl/issues/5062 --- src/backends/gr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 7e9cc2771..584ded397 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1370,7 +1370,7 @@ gr_set_window(sp, vp) = if (yscale = sp[:yaxis][:scale]) ∈ _logScales scaleop |= gr_y_log_scales[yscale] end - if needs_3d && (zscale = sp[:zaxis][:scale] ∈ _logScales) + if needs_3d && ((zscale = sp[:zaxis][:scale]) ∈ _logScales) scaleop |= gr_z_log_scales[zscale] end sp[:xaxis][:flip] && (scaleop |= GR.OPTION_FLIP_X)