can't blend gradient colors with a stream
$begingroup$
The following function generates a plot of the 3d function indicated in the example.
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> {Texture[
StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3,
3}, {y, -3, 3}, Frame -> None, ImageSize -> Large,
StreamStyle -> Black]]}]
However, when I choose a different ColorFunction parameter the texture (that only consists of arrows) disappears. Any idea how to correct this? I tried to make the background transparent, combine two 3D plots etc without success. Also, I have no idea why this is happening.
Here is the 3D plot without the gradient field.
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> {Texture[
StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3,
3}, {y, -3, 3}, Frame -> None, ImageSize -> Large,
StreamStyle -> Black]]}, ColorFunction -> "Rainbow"]
plotting style textures
New contributor
$endgroup$
add a comment |
$begingroup$
The following function generates a plot of the 3d function indicated in the example.
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> {Texture[
StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3,
3}, {y, -3, 3}, Frame -> None, ImageSize -> Large,
StreamStyle -> Black]]}]
However, when I choose a different ColorFunction parameter the texture (that only consists of arrows) disappears. Any idea how to correct this? I tried to make the background transparent, combine two 3D plots etc without success. Also, I have no idea why this is happening.
Here is the 3D plot without the gradient field.
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> {Texture[
StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3,
3}, {y, -3, 3}, Frame -> None, ImageSize -> Large,
StreamStyle -> Black]]}, ColorFunction -> "Rainbow"]
plotting style textures
New contributor
$endgroup$
add a comment |
$begingroup$
The following function generates a plot of the 3d function indicated in the example.
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> {Texture[
StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3,
3}, {y, -3, 3}, Frame -> None, ImageSize -> Large,
StreamStyle -> Black]]}]
However, when I choose a different ColorFunction parameter the texture (that only consists of arrows) disappears. Any idea how to correct this? I tried to make the background transparent, combine two 3D plots etc without success. Also, I have no idea why this is happening.
Here is the 3D plot without the gradient field.
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> {Texture[
StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3,
3}, {y, -3, 3}, Frame -> None, ImageSize -> Large,
StreamStyle -> Black]]}, ColorFunction -> "Rainbow"]
plotting style textures
New contributor
$endgroup$
The following function generates a plot of the 3d function indicated in the example.
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> {Texture[
StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3,
3}, {y, -3, 3}, Frame -> None, ImageSize -> Large,
StreamStyle -> Black]]}]
However, when I choose a different ColorFunction parameter the texture (that only consists of arrows) disappears. Any idea how to correct this? I tried to make the background transparent, combine two 3D plots etc without success. Also, I have no idea why this is happening.
Here is the 3D plot without the gradient field.
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> {Texture[
StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3,
3}, {y, -3, 3}, Frame -> None, ImageSize -> Large,
StreamStyle -> Black]]}, ColorFunction -> "Rainbow"]
plotting style textures
plotting style textures
New contributor
New contributor
edited 10 hours ago
Mr.Wizard♦
231k294741041
231k294741041
New contributor
asked 11 hours ago
user17164user17164
1262
1262
New contributor
New contributor
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
You can use StreamDensityPlot
(which accepts the ColorFunction
option) to produce the texture:
sdp = StreamDensityPlot[Evaluate[{-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}],
(x^2 + y^2) Exp[1 - x^2 - y^2]}], {x, -3, 3}, {y, -3, 3},
StreamStyle -> Black,
ColorFunction -> "Rainbow",
ColorFunctionScaling -> False, Frame -> False, Axes -> False,
PlotRangePadding -> None];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> Texture[Lighter@sdp], Lighting -> "Neutral"]
$endgroup$
$begingroup$
Slightly shorter:sdp = StreamDensityPlot[ Evaluate[{-D[#, {{x, y}}], #} &[(x^2 + y^2) Exp[ 1 - x^2 - y^2]]], {x, -3, 3}, {y, -3, 3}, StreamStyle -> Black, ColorFunction -> "Rainbow", Frame -> False, Axes -> False, PlotRangePadding -> None];
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2, I tried that version; but the colors do not match the colors in Plot3D.
$endgroup$
– kglr
7 hours ago
$begingroup$
Odd, they match your code above, for me. I switched between the two images and saw no (perceptible) difference.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2, maybe version/os difference (i am using v 11.3 windows 10/64bit).
$endgroup$
– kglr
7 hours ago
$begingroup$
@MichaelE2,ColorFunction -> "Rainbow"
does work if the first argument ofStreamDensityPlot
has the form ${{v_x, v_y}, s }$.
$endgroup$
– kglr
5 hours ago
|
show 2 more comments
$begingroup$
The color is not quite right but the idea seems to work. Edit: much closer now.
dp = DensityPlot[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
ColorFunction -> "Rainbow", PlotPoints -> 100];
sp = StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3, 3}, {y, -3, 3},
Frame -> None, ImageSize -> Large, StreamStyle -> Black];
tex = Show[dp, sp, Frame -> None, PlotRangePadding -> 0, ImageSize -> 500];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3}, Mesh -> None,
ImageSize -> Large, PlotPoints -> 35
, PlotStyle -> {Texture[Lighter[tex, 0.15]]}
, Lighting -> "Neutral"
]
$endgroup$
add a comment |
$begingroup$
PlotStyle -> Texture[...]
relies on VertexTextureCoordinates
to map the texture to polygon vertices.
ColorFunction -> colorfunction
relies on VertexColors
to associate colors with the polygon vertices.
Only one of them actually gets to style the polygon. In my case, it seems to be the texture:
Graphics3D[{Texture[RandomImage[1, 100]],
Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}},
VertexColors -> {Red, Green, Blue},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}}]},
Lighting -> "Neutral", BoxRatios -> {1, 1, 1}]
It sounds like the color function is winning in your case. It wouldn't surprise me if that was dependent on things like OS, software version, phase of the moon, etc...
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
user17164 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f189485%2fcant-blend-gradient-colors-with-a-stream%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You can use StreamDensityPlot
(which accepts the ColorFunction
option) to produce the texture:
sdp = StreamDensityPlot[Evaluate[{-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}],
(x^2 + y^2) Exp[1 - x^2 - y^2]}], {x, -3, 3}, {y, -3, 3},
StreamStyle -> Black,
ColorFunction -> "Rainbow",
ColorFunctionScaling -> False, Frame -> False, Axes -> False,
PlotRangePadding -> None];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> Texture[Lighter@sdp], Lighting -> "Neutral"]
$endgroup$
$begingroup$
Slightly shorter:sdp = StreamDensityPlot[ Evaluate[{-D[#, {{x, y}}], #} &[(x^2 + y^2) Exp[ 1 - x^2 - y^2]]], {x, -3, 3}, {y, -3, 3}, StreamStyle -> Black, ColorFunction -> "Rainbow", Frame -> False, Axes -> False, PlotRangePadding -> None];
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2, I tried that version; but the colors do not match the colors in Plot3D.
$endgroup$
– kglr
7 hours ago
$begingroup$
Odd, they match your code above, for me. I switched between the two images and saw no (perceptible) difference.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2, maybe version/os difference (i am using v 11.3 windows 10/64bit).
$endgroup$
– kglr
7 hours ago
$begingroup$
@MichaelE2,ColorFunction -> "Rainbow"
does work if the first argument ofStreamDensityPlot
has the form ${{v_x, v_y}, s }$.
$endgroup$
– kglr
5 hours ago
|
show 2 more comments
$begingroup$
You can use StreamDensityPlot
(which accepts the ColorFunction
option) to produce the texture:
sdp = StreamDensityPlot[Evaluate[{-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}],
(x^2 + y^2) Exp[1 - x^2 - y^2]}], {x, -3, 3}, {y, -3, 3},
StreamStyle -> Black,
ColorFunction -> "Rainbow",
ColorFunctionScaling -> False, Frame -> False, Axes -> False,
PlotRangePadding -> None];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> Texture[Lighter@sdp], Lighting -> "Neutral"]
$endgroup$
$begingroup$
Slightly shorter:sdp = StreamDensityPlot[ Evaluate[{-D[#, {{x, y}}], #} &[(x^2 + y^2) Exp[ 1 - x^2 - y^2]]], {x, -3, 3}, {y, -3, 3}, StreamStyle -> Black, ColorFunction -> "Rainbow", Frame -> False, Axes -> False, PlotRangePadding -> None];
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2, I tried that version; but the colors do not match the colors in Plot3D.
$endgroup$
– kglr
7 hours ago
$begingroup$
Odd, they match your code above, for me. I switched between the two images and saw no (perceptible) difference.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2, maybe version/os difference (i am using v 11.3 windows 10/64bit).
$endgroup$
– kglr
7 hours ago
$begingroup$
@MichaelE2,ColorFunction -> "Rainbow"
does work if the first argument ofStreamDensityPlot
has the form ${{v_x, v_y}, s }$.
$endgroup$
– kglr
5 hours ago
|
show 2 more comments
$begingroup$
You can use StreamDensityPlot
(which accepts the ColorFunction
option) to produce the texture:
sdp = StreamDensityPlot[Evaluate[{-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}],
(x^2 + y^2) Exp[1 - x^2 - y^2]}], {x, -3, 3}, {y, -3, 3},
StreamStyle -> Black,
ColorFunction -> "Rainbow",
ColorFunctionScaling -> False, Frame -> False, Axes -> False,
PlotRangePadding -> None];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> Texture[Lighter@sdp], Lighting -> "Neutral"]
$endgroup$
You can use StreamDensityPlot
(which accepts the ColorFunction
option) to produce the texture:
sdp = StreamDensityPlot[Evaluate[{-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}],
(x^2 + y^2) Exp[1 - x^2 - y^2]}], {x, -3, 3}, {y, -3, 3},
StreamStyle -> Black,
ColorFunction -> "Rainbow",
ColorFunctionScaling -> False, Frame -> False, Axes -> False,
PlotRangePadding -> None];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
Mesh -> None, ImageSize -> Large, PlotPoints -> 35,
PlotStyle -> Texture[Lighter@sdp], Lighting -> "Neutral"]
edited 5 hours ago
answered 9 hours ago
kglrkglr
179k9198409
179k9198409
$begingroup$
Slightly shorter:sdp = StreamDensityPlot[ Evaluate[{-D[#, {{x, y}}], #} &[(x^2 + y^2) Exp[ 1 - x^2 - y^2]]], {x, -3, 3}, {y, -3, 3}, StreamStyle -> Black, ColorFunction -> "Rainbow", Frame -> False, Axes -> False, PlotRangePadding -> None];
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2, I tried that version; but the colors do not match the colors in Plot3D.
$endgroup$
– kglr
7 hours ago
$begingroup$
Odd, they match your code above, for me. I switched between the two images and saw no (perceptible) difference.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2, maybe version/os difference (i am using v 11.3 windows 10/64bit).
$endgroup$
– kglr
7 hours ago
$begingroup$
@MichaelE2,ColorFunction -> "Rainbow"
does work if the first argument ofStreamDensityPlot
has the form ${{v_x, v_y}, s }$.
$endgroup$
– kglr
5 hours ago
|
show 2 more comments
$begingroup$
Slightly shorter:sdp = StreamDensityPlot[ Evaluate[{-D[#, {{x, y}}], #} &[(x^2 + y^2) Exp[ 1 - x^2 - y^2]]], {x, -3, 3}, {y, -3, 3}, StreamStyle -> Black, ColorFunction -> "Rainbow", Frame -> False, Axes -> False, PlotRangePadding -> None];
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2, I tried that version; but the colors do not match the colors in Plot3D.
$endgroup$
– kglr
7 hours ago
$begingroup$
Odd, they match your code above, for me. I switched between the two images and saw no (perceptible) difference.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2, maybe version/os difference (i am using v 11.3 windows 10/64bit).
$endgroup$
– kglr
7 hours ago
$begingroup$
@MichaelE2,ColorFunction -> "Rainbow"
does work if the first argument ofStreamDensityPlot
has the form ${{v_x, v_y}, s }$.
$endgroup$
– kglr
5 hours ago
$begingroup$
Slightly shorter:
sdp = StreamDensityPlot[ Evaluate[{-D[#, {{x, y}}], #} &[(x^2 + y^2) Exp[ 1 - x^2 - y^2]]], {x, -3, 3}, {y, -3, 3}, StreamStyle -> Black, ColorFunction -> "Rainbow", Frame -> False, Axes -> False, PlotRangePadding -> None];
$endgroup$
– Michael E2
8 hours ago
$begingroup$
Slightly shorter:
sdp = StreamDensityPlot[ Evaluate[{-D[#, {{x, y}}], #} &[(x^2 + y^2) Exp[ 1 - x^2 - y^2]]], {x, -3, 3}, {y, -3, 3}, StreamStyle -> Black, ColorFunction -> "Rainbow", Frame -> False, Axes -> False, PlotRangePadding -> None];
$endgroup$
– Michael E2
8 hours ago
$begingroup$
@MichaelE2, I tried that version; but the colors do not match the colors in Plot3D.
$endgroup$
– kglr
7 hours ago
$begingroup$
@MichaelE2, I tried that version; but the colors do not match the colors in Plot3D.
$endgroup$
– kglr
7 hours ago
$begingroup$
Odd, they match your code above, for me. I switched between the two images and saw no (perceptible) difference.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
Odd, they match your code above, for me. I switched between the two images and saw no (perceptible) difference.
$endgroup$
– Michael E2
7 hours ago
$begingroup$
@MichaelE2, maybe version/os difference (i am using v 11.3 windows 10/64bit).
$endgroup$
– kglr
7 hours ago
$begingroup$
@MichaelE2, maybe version/os difference (i am using v 11.3 windows 10/64bit).
$endgroup$
– kglr
7 hours ago
$begingroup$
@MichaelE2,
ColorFunction -> "Rainbow"
does work if the first argument of StreamDensityPlot
has the form ${{v_x, v_y}, s }$.$endgroup$
– kglr
5 hours ago
$begingroup$
@MichaelE2,
ColorFunction -> "Rainbow"
does work if the first argument of StreamDensityPlot
has the form ${{v_x, v_y}, s }$.$endgroup$
– kglr
5 hours ago
|
show 2 more comments
$begingroup$
The color is not quite right but the idea seems to work. Edit: much closer now.
dp = DensityPlot[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
ColorFunction -> "Rainbow", PlotPoints -> 100];
sp = StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3, 3}, {y, -3, 3},
Frame -> None, ImageSize -> Large, StreamStyle -> Black];
tex = Show[dp, sp, Frame -> None, PlotRangePadding -> 0, ImageSize -> 500];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3}, Mesh -> None,
ImageSize -> Large, PlotPoints -> 35
, PlotStyle -> {Texture[Lighter[tex, 0.15]]}
, Lighting -> "Neutral"
]
$endgroup$
add a comment |
$begingroup$
The color is not quite right but the idea seems to work. Edit: much closer now.
dp = DensityPlot[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
ColorFunction -> "Rainbow", PlotPoints -> 100];
sp = StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3, 3}, {y, -3, 3},
Frame -> None, ImageSize -> Large, StreamStyle -> Black];
tex = Show[dp, sp, Frame -> None, PlotRangePadding -> 0, ImageSize -> 500];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3}, Mesh -> None,
ImageSize -> Large, PlotPoints -> 35
, PlotStyle -> {Texture[Lighter[tex, 0.15]]}
, Lighting -> "Neutral"
]
$endgroup$
add a comment |
$begingroup$
The color is not quite right but the idea seems to work. Edit: much closer now.
dp = DensityPlot[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
ColorFunction -> "Rainbow", PlotPoints -> 100];
sp = StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3, 3}, {y, -3, 3},
Frame -> None, ImageSize -> Large, StreamStyle -> Black];
tex = Show[dp, sp, Frame -> None, PlotRangePadding -> 0, ImageSize -> 500];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3}, Mesh -> None,
ImageSize -> Large, PlotPoints -> 35
, PlotStyle -> {Texture[Lighter[tex, 0.15]]}
, Lighting -> "Neutral"
]
$endgroup$
The color is not quite right but the idea seems to work. Edit: much closer now.
dp = DensityPlot[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3},
ColorFunction -> "Rainbow", PlotPoints -> 100];
sp = StreamPlot[
Evaluate[-D[(x^2 + y^2) Exp[1 - x^2 - y^2], {{x, y}}]], {x, -3, 3}, {y, -3, 3},
Frame -> None, ImageSize -> Large, StreamStyle -> Black];
tex = Show[dp, sp, Frame -> None, PlotRangePadding -> 0, ImageSize -> 500];
Plot3D[(x^2 + y^2) Exp[1 - x^2 - y^2], {x, -3, 3}, {y, -3, 3}, Mesh -> None,
ImageSize -> Large, PlotPoints -> 35
, PlotStyle -> {Texture[Lighter[tex, 0.15]]}
, Lighting -> "Neutral"
]
edited 10 hours ago
answered 10 hours ago
Mr.Wizard♦Mr.Wizard
231k294741041
231k294741041
add a comment |
add a comment |
$begingroup$
PlotStyle -> Texture[...]
relies on VertexTextureCoordinates
to map the texture to polygon vertices.
ColorFunction -> colorfunction
relies on VertexColors
to associate colors with the polygon vertices.
Only one of them actually gets to style the polygon. In my case, it seems to be the texture:
Graphics3D[{Texture[RandomImage[1, 100]],
Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}},
VertexColors -> {Red, Green, Blue},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}}]},
Lighting -> "Neutral", BoxRatios -> {1, 1, 1}]
It sounds like the color function is winning in your case. It wouldn't surprise me if that was dependent on things like OS, software version, phase of the moon, etc...
$endgroup$
add a comment |
$begingroup$
PlotStyle -> Texture[...]
relies on VertexTextureCoordinates
to map the texture to polygon vertices.
ColorFunction -> colorfunction
relies on VertexColors
to associate colors with the polygon vertices.
Only one of them actually gets to style the polygon. In my case, it seems to be the texture:
Graphics3D[{Texture[RandomImage[1, 100]],
Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}},
VertexColors -> {Red, Green, Blue},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}}]},
Lighting -> "Neutral", BoxRatios -> {1, 1, 1}]
It sounds like the color function is winning in your case. It wouldn't surprise me if that was dependent on things like OS, software version, phase of the moon, etc...
$endgroup$
add a comment |
$begingroup$
PlotStyle -> Texture[...]
relies on VertexTextureCoordinates
to map the texture to polygon vertices.
ColorFunction -> colorfunction
relies on VertexColors
to associate colors with the polygon vertices.
Only one of them actually gets to style the polygon. In my case, it seems to be the texture:
Graphics3D[{Texture[RandomImage[1, 100]],
Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}},
VertexColors -> {Red, Green, Blue},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}}]},
Lighting -> "Neutral", BoxRatios -> {1, 1, 1}]
It sounds like the color function is winning in your case. It wouldn't surprise me if that was dependent on things like OS, software version, phase of the moon, etc...
$endgroup$
PlotStyle -> Texture[...]
relies on VertexTextureCoordinates
to map the texture to polygon vertices.
ColorFunction -> colorfunction
relies on VertexColors
to associate colors with the polygon vertices.
Only one of them actually gets to style the polygon. In my case, it seems to be the texture:
Graphics3D[{Texture[RandomImage[1, 100]],
Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}},
VertexColors -> {Red, Green, Blue},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}}]},
Lighting -> "Neutral", BoxRatios -> {1, 1, 1}]
It sounds like the color function is winning in your case. It wouldn't surprise me if that was dependent on things like OS, software version, phase of the moon, etc...
answered 10 hours ago
Brett ChampionBrett Champion
17.2k251114
17.2k251114
add a comment |
add a comment |
user17164 is a new contributor. Be nice, and check out our Code of Conduct.
user17164 is a new contributor. Be nice, and check out our Code of Conduct.
user17164 is a new contributor. Be nice, and check out our Code of Conduct.
user17164 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f189485%2fcant-blend-gradient-colors-with-a-stream%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown