Bug introduced in 14.0 and fixed in 14.1
Switching to Version 14.0 (Linux), I noticed that Directive
behaves unexpectedly when used inside ColorFunction for 3D Graphics. I wasn't able to find any further information on it, and I didn't want to assume anything, but it seems like a bug to me.
Compare:
Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2},
ColorFunction->Function[{x,y,f},Blue], Mesh -> None]
with
Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2},
ColorFunction->Function[{x,y,f},Directive[Blue]], Mesh -> None]
This doesn't happen in 13.0 nor 11.3.
(More useful examples like Directive[Blue,Opacity[0.5]]
etc. are of course also affected.)
All 3D plots I tried are affected, while 2D Plot
seems to work.
On the other hand,
Graphics3D[{Directive[Blue,Opacity[0.5]],Sphere[]}]
also works as expected.
Edit: The same effect results when using List
instead of Directive
. This for example means that Hue[0.5,1,1,0.5]
works, but {Hue[0.5],Opacity[0.5]}
, does not, even though the documentation says the two are equivalent.
Edit2: Note that this problem doesn't depend on using the arguments to ColorFunction
, which is why the example simply uses Blue
. Of course, for real applications of ColorFunction
, the function would not be constant, meaning that PlotStyle
doesn't help.
PlotStyle -> Directive[...]
$\endgroup$PlotStyle
would work for the very simplified example here, but for the real application, I need theColorFunction
arguments. @Lexington1776 Good to know, thanks. $\endgroup$