GR: surface, add the possibility to override the hardcoded nx and ny in GR.gridit(...)

This commit is contained in:
t-bltg 2021-07-01 16:54:07 +02:00
parent a7c629f775
commit e42b4ad34d

View File

@ -1845,8 +1845,10 @@ function gr_draw_surface(series, x, y, z, clims)
if series[:seriestype] === :surface if series[:seriestype] === :surface
fillalpha = get_fillalpha(series) fillalpha = get_fillalpha(series)
fillcolor = get_fillcolor(series) fillcolor = get_fillcolor(series)
if length(x) == length(y) == length(z) # NOTE: setting nx = 0 or ny = 0 disables GR.gridit interpolation
x, y, z = GR.gridit(x, y, z, 200, 200) nx, ny = get(e_kwargs, :nx, 200), get(e_kwargs, :ny, 200)
if length(x) == length(y) == length(z) && nx > 0 && ny > 0
x, y, z = GR.gridit(x, y, z, nx, ny)
end end
d_opt = get(e_kwargs, :display_option, GR.OPTION_COLORED_MESH) d_opt = get(e_kwargs, :display_option, GR.OPTION_COLORED_MESH)
if (!isnothing(fillalpha) && fillalpha < 1) || alpha(first(fillcolor)) < 1 if (!isnothing(fillalpha) && fillalpha < 1) || alpha(first(fillcolor)) < 1