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 1 hour ago
Mr.Wizard♦
231k294741041
231k294741041
New contributor
asked 1 hour ago
user17164user17164
1212
1212
New contributor
New contributor
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$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$
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, -3,
3}, {y, -3, 3}, StreamStyle -> Black,
ColorFunction -> (ColorData["Rainbow"][(#^2 + #2^2) Exp[1 - #^2 - #2^2]] &),
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[sdp]}, 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$
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 1 hour ago
answered 1 hour ago
Mr.Wizard♦Mr.Wizard
231k294741041
231k294741041
add a comment |
add a comment |
$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, -3,
3}, {y, -3, 3}, StreamStyle -> Black,
ColorFunction -> (ColorData["Rainbow"][(#^2 + #2^2) Exp[1 - #^2 - #2^2]] &),
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[sdp]}, Lighting -> "Neutral"]
$endgroup$
add a comment |
$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, -3,
3}, {y, -3, 3}, StreamStyle -> Black,
ColorFunction -> (ColorData["Rainbow"][(#^2 + #2^2) Exp[1 - #^2 - #2^2]] &),
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[sdp]}, Lighting -> "Neutral"]
$endgroup$
add a comment |
$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, -3,
3}, {y, -3, 3}, StreamStyle -> Black,
ColorFunction -> (ColorData["Rainbow"][(#^2 + #2^2) Exp[1 - #^2 - #2^2]] &),
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[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, -3,
3}, {y, -3, 3}, StreamStyle -> Black,
ColorFunction -> (ColorData["Rainbow"][(#^2 + #2^2) Exp[1 - #^2 - #2^2]] &),
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[sdp]}, Lighting -> "Neutral"]
answered 47 mins ago
kglrkglr
178k9198409
178k9198409
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 1 hour 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