Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reflections from surface plots? #514

Open
fvmarcoline opened this issue Apr 21, 2023 · 0 comments
Open

Remove reflections from surface plots? #514

fvmarcoline opened this issue Apr 21, 2023 · 0 comments

Comments

@fvmarcoline
Copy link

fvmarcoline commented Apr 21, 2023

Hello. Is there a way to turn off reflections on surface plots? In the following example, the colors are modified near the surface extrema and saddle points due to, presumably, reflections from a light source.

using Plots
x = -2π:0.02:2π;
z = sin.(x) .* sin.(x)';
ticks = (-2π:π:2π, ["-2π";"-π";"0";"π";"2π"]);
plot(surface(x, x, z, camera=(0,90), aspect_ratio=:equal, xlims=extrema(x), ylims=extrema(x), ymirror=:true, zticks=[], zlims=(-2,2), clims=(-2,2), framestyle=:box, xticks=ticks, yticks=ticks,left_margin=8mm,right_margin=0mm,xlabel="surface()"),
            heatmap(x, x, z, aspect_ratio=:equal,xlims=extrema(x),ylims=extrema(x),clims=(-2,2),zlims=(-2,2), framestyle=:box, xticks=ticks, yticks=ticks,xlabel="heatmap()",left_margin=-5mm),size=(800,360),layout=@layout [a{0.53w} b])

surface_lighting

While heatmap() does not have these surface reflections, in practice, I am using surface() because my x and y inputs are generally not regular, and heatmap, to my knowledge, requires a regular grid. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant