can't blend gradient colors with a stream












5












$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"]









share|improve this question









New contributor




user17164 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$

















    5












    $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"]









    share|improve this question









    New contributor




    user17164 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.







    $endgroup$















      5












      5








      5





      $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"]









      share|improve this question









      New contributor




      user17164 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      $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






      share|improve this question









      New contributor




      user17164 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      user17164 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 10 hours ago









      Mr.Wizard

      231k294741041




      231k294741041






      New contributor




      user17164 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 11 hours ago









      user17164user17164

      1262




      1262




      New contributor




      user17164 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      user17164 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      user17164 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          3 Answers
          3






          active

          oldest

          votes


















          9












          $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"]


          enter image description here






          share|improve this answer











          $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 of StreamDensityPlot has the form ${{v_x, v_y}, s }$.
            $endgroup$
            – kglr
            5 hours ago



















          8












          $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"
          ]


          enter image description here






          share|improve this answer











          $endgroup$





















            2












            $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}]


            enter image description here



            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...






            share|improve this answer









            $endgroup$













              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.










              draft saved

              draft discarded


















              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









              9












              $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"]


              enter image description here






              share|improve this answer











              $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 of StreamDensityPlot has the form ${{v_x, v_y}, s }$.
                $endgroup$
                – kglr
                5 hours ago
















              9












              $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"]


              enter image description here






              share|improve this answer











              $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 of StreamDensityPlot has the form ${{v_x, v_y}, s }$.
                $endgroup$
                – kglr
                5 hours ago














              9












              9








              9





              $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"]


              enter image description here






              share|improve this answer











              $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"]


              enter image description here







              share|improve this answer














              share|improve this answer



              share|improve this answer








              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 of StreamDensityPlot 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$
                @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 of StreamDensityPlot 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











              8












              $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"
              ]


              enter image description here






              share|improve this answer











              $endgroup$


















                8












                $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"
                ]


                enter image description here






                share|improve this answer











                $endgroup$
















                  8












                  8








                  8





                  $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"
                  ]


                  enter image description here






                  share|improve this answer











                  $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"
                  ]


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 10 hours ago

























                  answered 10 hours ago









                  Mr.WizardMr.Wizard

                  231k294741041




                  231k294741041























                      2












                      $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}]


                      enter image description here



                      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...






                      share|improve this answer









                      $endgroup$


















                        2












                        $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}]


                        enter image description here



                        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...






                        share|improve this answer









                        $endgroup$
















                          2












                          2








                          2





                          $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}]


                          enter image description here



                          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...






                          share|improve this answer









                          $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}]


                          enter image description here



                          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...







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 10 hours ago









                          Brett ChampionBrett Champion

                          17.2k251114




                          17.2k251114






















                              user17164 is a new contributor. Be nice, and check out our Code of Conduct.










                              draft saved

                              draft discarded


















                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              GameSpot

                              日野市

                              Tu-95轟炸機