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

[BUG] Surface transparency #4683

Closed
maucejo opened this issue Mar 6, 2023 · 1 comment · Fixed by #4685
Closed

[BUG] Surface transparency #4683

maucejo opened this issue Mar 6, 2023 · 1 comment · Fixed by #4685

Comments

@maucejo
Copy link

maucejo commented Mar 6, 2023

Details

I don't if it's a known issue, but I am struggling with transparency with the gr and pythonplot backends.

I am trying to plot a transparent zx-plane. Here is the MWE:

using Plots

x = LinRange(0., 100., 100)
y = ones(50)

vl = LinRange(0., 1., 50)
v = repeat(vl', length(x), 1)
z = repeat(ones(length(x)), 1, length(vl)).*v

fig = plot()
surface!(y, x, z, c = cgrad([:blue, :blue]), fillalpha = 0.1, colorbar = false)
fig

With gr, when setting fillalpha to a value other than 1, the plane is not plotted. I think it is more related GR itself, since I receive the following warning points not sorted in ascending order. Note that this issue does not appear for a xy-plane.

With pythonplot, fillalpha has no effect at all, while it works well with the pyplot backend. This issue does not appear when I use PythonPlot.jl directly. (It should be noted that the figure displayed with Plots.jl is quite ugly compared to that obtained with PythonPlot.jl, but that is probably another story). This probably means that transparency is not yet implemented for pythonplot backend. Am I right ?

Thank you !

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pythonplot x
pyplot x
plotlyjs x
pgfplotsx
unicodeplots x
inspectdr x
gaston x

Versions

Plots.jl version: 1.38.6
Backend version (]st -m <backend(s)>):
PythonPlot v1.0.2
PyPlot v2.11.1
PlotlyJS v0.18.10
GR v0.71.7
Output of versioninfo():
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × Intel(R) Core(TM) i7-10610U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
Threads: 1 on 8 virtual cores
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS =

@maucejo maucejo added the bug label Mar 6, 2023
@t-bltg
Copy link
Member

t-bltg commented Mar 6, 2023

That's probably a bug introduced when I ported the pyplot backend to pythonplot.
Thanks for reporting, I'll have a look.

Reduced example:

surface(-10:.1:10, -10:.1:10, (x, y) -> 15sinc((x^2 + y^2) / π), c = cgrad([:blue, :blue]), fillalpha = 0.1)

TODO: check that we don't break #4665.

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

Successfully merging a pull request may close this issue.

2 participants