Show two plots together: a two dimensional curve tangent to the maxima of a three dimensional plotShow...

The teacher logged me in as administrator for doing a short task, is the whole system now compromised?

Shouldn't the "credit score" prevent Americans from going deeper and deeper into personal debt?

Should my "average" PC be able to discern the potential of encountering a gelatinous cube from subtle clues?

How to get the pandadocs from an opportunity?

Was 'help' pronounced starting with a vowel sound?

How to dismiss intrusive questions from a colleague with whom I don't work?

How to specify and fit a hybrid machine learning - linear model

In an emergency, how do I find and share my position?

Is it appropriate for a prospective landlord to ask me for my credit report?

Co-author responds to email by mistake cc'ing the EiC

Is there a known non-euclidean geometry where two concentric circles of different radii can intersect? (as in the novel "The Universe Between")

What happens when I copy a legendary creature with Rite of Replication?

Metal that glows when near pieces of itself

The logic of invoking virtual functions is not clear (or it is method hiding?)

What is the evidence on the danger of feeding whole blueberries and grapes to infants and toddlers?

How to compare two different formulations of a problem?

A second course in the representation theory

Why doesn't mathematics collapse even though humans quite often make mistakes in their proofs?

Something in the TV

The sound of thunder's like a whip

Was Switzerland really impossible to invade during WW2?

What can I do to keep a threaded bolt from falling out of its slot?

How to avoid using System.String with Rfc2898DeriveBytes in C#

Is there such a thing as too inconvenient?



Show two plots together: a two dimensional curve tangent to the maxima of a three dimensional plot


Show doesn't show all the plotsPlotting three-dimensional plot with Interpolating functionsLabeling a three-dimensional plotfit a curve in a three dimensional spaceShowing Two Manipulated Plots TogetherThree questions about two plotsColor three dimensional plot and contour plot the sameThe easiest way to plot two columns vs togetherAppendTo doesn't update when interacting with PopupMenu






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







5












$begingroup$


I have a list containing 3 columns and 6552 rows which can be found here.



The plot of data is shown below:



Enter image description here



We have a cross cut for a specific value of y, for example, y=0.01 or y=1.26 over this plot by (mathematica.dat is the uploaded file):



data3D = Import["mathematica.dat", "Table"];
yequalto01 = Rest /@ (Select[data3D, #[[1]] == 0.01 &]);
yequalto126 = Rest /@ (Select[data3D, #[[1]] == 1.26 &]);


From a two column data (yequalto01,yequalto126) we can extract the peaks by
peakValues = Pick[yequalto01, PeakDetect[yequalto01[[;; , 2]]], 1];



This list except the last pair can be presented as



peakValues ={{0.0, 1.000}, {4.4, 0.982}, {8.9, 0.961}, {13.3, 0.942}, {17.8, 0.923}, {22.2, 0.906}};


We plotted peakValues and drawn data3D separately. But, I wish to show two plots simultaneous in one figure as the below one which prepared by paint (blue and purple curves are tangent to the peaks of the 3D plot).



Enter image description here










share|improve this question











$endgroup$














  • $begingroup$
    You can combine plots using Show.
    $endgroup$
    – C. E.
    2 days ago


















5












$begingroup$


I have a list containing 3 columns and 6552 rows which can be found here.



The plot of data is shown below:



Enter image description here



We have a cross cut for a specific value of y, for example, y=0.01 or y=1.26 over this plot by (mathematica.dat is the uploaded file):



data3D = Import["mathematica.dat", "Table"];
yequalto01 = Rest /@ (Select[data3D, #[[1]] == 0.01 &]);
yequalto126 = Rest /@ (Select[data3D, #[[1]] == 1.26 &]);


From a two column data (yequalto01,yequalto126) we can extract the peaks by
peakValues = Pick[yequalto01, PeakDetect[yequalto01[[;; , 2]]], 1];



This list except the last pair can be presented as



peakValues ={{0.0, 1.000}, {4.4, 0.982}, {8.9, 0.961}, {13.3, 0.942}, {17.8, 0.923}, {22.2, 0.906}};


We plotted peakValues and drawn data3D separately. But, I wish to show two plots simultaneous in one figure as the below one which prepared by paint (blue and purple curves are tangent to the peaks of the 3D plot).



Enter image description here










share|improve this question











$endgroup$














  • $begingroup$
    You can combine plots using Show.
    $endgroup$
    – C. E.
    2 days ago














5












5








5





$begingroup$


I have a list containing 3 columns and 6552 rows which can be found here.



The plot of data is shown below:



Enter image description here



We have a cross cut for a specific value of y, for example, y=0.01 or y=1.26 over this plot by (mathematica.dat is the uploaded file):



data3D = Import["mathematica.dat", "Table"];
yequalto01 = Rest /@ (Select[data3D, #[[1]] == 0.01 &]);
yequalto126 = Rest /@ (Select[data3D, #[[1]] == 1.26 &]);


From a two column data (yequalto01,yequalto126) we can extract the peaks by
peakValues = Pick[yequalto01, PeakDetect[yequalto01[[;; , 2]]], 1];



This list except the last pair can be presented as



peakValues ={{0.0, 1.000}, {4.4, 0.982}, {8.9, 0.961}, {13.3, 0.942}, {17.8, 0.923}, {22.2, 0.906}};


We plotted peakValues and drawn data3D separately. But, I wish to show two plots simultaneous in one figure as the below one which prepared by paint (blue and purple curves are tangent to the peaks of the 3D plot).



Enter image description here










share|improve this question











$endgroup$




I have a list containing 3 columns and 6552 rows which can be found here.



The plot of data is shown below:



Enter image description here



We have a cross cut for a specific value of y, for example, y=0.01 or y=1.26 over this plot by (mathematica.dat is the uploaded file):



data3D = Import["mathematica.dat", "Table"];
yequalto01 = Rest /@ (Select[data3D, #[[1]] == 0.01 &]);
yequalto126 = Rest /@ (Select[data3D, #[[1]] == 1.26 &]);


From a two column data (yequalto01,yequalto126) we can extract the peaks by
peakValues = Pick[yequalto01, PeakDetect[yequalto01[[;; , 2]]], 1];



This list except the last pair can be presented as



peakValues ={{0.0, 1.000}, {4.4, 0.982}, {8.9, 0.961}, {13.3, 0.942}, {17.8, 0.923}, {22.2, 0.906}};


We plotted peakValues and drawn data3D separately. But, I wish to show two plots simultaneous in one figure as the below one which prepared by paint (blue and purple curves are tangent to the peaks of the 3D plot).



Enter image description here







plotting list-manipulation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Peter Mortensen

3462 silver badges7 bronze badges




3462 silver badges7 bronze badges










asked 2 days ago









UnbelievableUnbelievable

2,2779 silver badges31 bronze badges




2,2779 silver badges31 bronze badges















  • $begingroup$
    You can combine plots using Show.
    $endgroup$
    – C. E.
    2 days ago


















  • $begingroup$
    You can combine plots using Show.
    $endgroup$
    – C. E.
    2 days ago
















$begingroup$
You can combine plots using Show.
$endgroup$
– C. E.
2 days ago




$begingroup$
You can combine plots using Show.
$endgroup$
– C. E.
2 days ago










2 Answers
2






active

oldest

votes


















7












$begingroup$

peakValues01 = 
Pick[yequalto01, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];
peakValues126 =
Pick[yequalto126, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];

p01 = Join[{ConstantArray[0.01, Length[peakValues01]]},
peakValues01[Transpose]][Transpose];
p126 = Join[{ConstantArray[1.26, Length[peakValues126]]},
peakValues126[Transpose]][Transpose];


Show[
ListPlot3D[data3D],
ListPointPlot3D[p01],
Graphics3D@Line@p01,
ListPointPlot3D[p126],
Graphics3D@Line@p126
]



enter image description here




Of course, you can customise the lines/dots as you want with the standard options.
If you want smooth lines between the points, I would try with interpolating first and then a ParametricPlot:



p01f[x_] = Interpolation[peakValues01][x];
p126f[x_] = Interpolation[peakValues126][x];

htl = Join[{#*[Pi], #*[Pi], {0.014, 0}} & /@
Range[0, 8, 2], {#*[Pi], "", {0.01, 0}} & /@ Range[0, 8, 1]];

Show[
ListPlot3D[data3D, ColorFunction -> "TemperatureMap", Mesh -> None
, Ticks -> {Automatic, htl, Automatic}, BoxStyle -> Dashed,
AxesLabel -> {"y", "x"}],
ListPointPlot3D[p01, PlotStyle -> {Purple}],
ListPointPlot3D[p126, PlotStyle -> {Blue}],
ParametricPlot3D[{0.01, x, p01f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
PlotStyle -> {Purple, Thickness[0.02]}],
ParametricPlot3D[{1.26, x, p126f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
PlotStyle -> {Blue, Thickness[0.02]}],
ViewPoint -> {4, 1, 1}
]



enter image description here







share|improve this answer











$endgroup$























    6












    $begingroup$

    {y01, y126} = Table[Select[data3D, #[[1]] == i &], {i, {.01, 1.26}}];

    {peaks01, peaks126} = Pick[#, PeakDetect[#[[;; , 3]]], 1] & /@ {y01, y126};

    Show[ListPlot3D[data3D],
    Graphics3D[{PointSize[Large], Thick, Red, Line @ peaks01, Point @ peaks01,
    Green, Line @ peaks126, Point@ peaks126}]]


    enter image description here






    share|improve this answer











    $endgroup$


















      Your Answer








      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
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f203890%2fshow-two-plots-together-a-two-dimensional-curve-tangent-to-the-maxima-of-a-thre%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      7












      $begingroup$

      peakValues01 = 
      Pick[yequalto01, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];
      peakValues126 =
      Pick[yequalto126, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];

      p01 = Join[{ConstantArray[0.01, Length[peakValues01]]},
      peakValues01[Transpose]][Transpose];
      p126 = Join[{ConstantArray[1.26, Length[peakValues126]]},
      peakValues126[Transpose]][Transpose];


      Show[
      ListPlot3D[data3D],
      ListPointPlot3D[p01],
      Graphics3D@Line@p01,
      ListPointPlot3D[p126],
      Graphics3D@Line@p126
      ]



      enter image description here




      Of course, you can customise the lines/dots as you want with the standard options.
      If you want smooth lines between the points, I would try with interpolating first and then a ParametricPlot:



      p01f[x_] = Interpolation[peakValues01][x];
      p126f[x_] = Interpolation[peakValues126][x];

      htl = Join[{#*[Pi], #*[Pi], {0.014, 0}} & /@
      Range[0, 8, 2], {#*[Pi], "", {0.01, 0}} & /@ Range[0, 8, 1]];

      Show[
      ListPlot3D[data3D, ColorFunction -> "TemperatureMap", Mesh -> None
      , Ticks -> {Automatic, htl, Automatic}, BoxStyle -> Dashed,
      AxesLabel -> {"y", "x"}],
      ListPointPlot3D[p01, PlotStyle -> {Purple}],
      ListPointPlot3D[p126, PlotStyle -> {Blue}],
      ParametricPlot3D[{0.01, x, p01f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
      PlotStyle -> {Purple, Thickness[0.02]}],
      ParametricPlot3D[{1.26, x, p126f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
      PlotStyle -> {Blue, Thickness[0.02]}],
      ViewPoint -> {4, 1, 1}
      ]



      enter image description here







      share|improve this answer











      $endgroup$




















        7












        $begingroup$

        peakValues01 = 
        Pick[yequalto01, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];
        peakValues126 =
        Pick[yequalto126, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];

        p01 = Join[{ConstantArray[0.01, Length[peakValues01]]},
        peakValues01[Transpose]][Transpose];
        p126 = Join[{ConstantArray[1.26, Length[peakValues126]]},
        peakValues126[Transpose]][Transpose];


        Show[
        ListPlot3D[data3D],
        ListPointPlot3D[p01],
        Graphics3D@Line@p01,
        ListPointPlot3D[p126],
        Graphics3D@Line@p126
        ]



        enter image description here




        Of course, you can customise the lines/dots as you want with the standard options.
        If you want smooth lines between the points, I would try with interpolating first and then a ParametricPlot:



        p01f[x_] = Interpolation[peakValues01][x];
        p126f[x_] = Interpolation[peakValues126][x];

        htl = Join[{#*[Pi], #*[Pi], {0.014, 0}} & /@
        Range[0, 8, 2], {#*[Pi], "", {0.01, 0}} & /@ Range[0, 8, 1]];

        Show[
        ListPlot3D[data3D, ColorFunction -> "TemperatureMap", Mesh -> None
        , Ticks -> {Automatic, htl, Automatic}, BoxStyle -> Dashed,
        AxesLabel -> {"y", "x"}],
        ListPointPlot3D[p01, PlotStyle -> {Purple}],
        ListPointPlot3D[p126, PlotStyle -> {Blue}],
        ParametricPlot3D[{0.01, x, p01f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
        PlotStyle -> {Purple, Thickness[0.02]}],
        ParametricPlot3D[{1.26, x, p126f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
        PlotStyle -> {Blue, Thickness[0.02]}],
        ViewPoint -> {4, 1, 1}
        ]



        enter image description here







        share|improve this answer











        $endgroup$


















          7












          7








          7





          $begingroup$

          peakValues01 = 
          Pick[yequalto01, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];
          peakValues126 =
          Pick[yequalto126, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];

          p01 = Join[{ConstantArray[0.01, Length[peakValues01]]},
          peakValues01[Transpose]][Transpose];
          p126 = Join[{ConstantArray[1.26, Length[peakValues126]]},
          peakValues126[Transpose]][Transpose];


          Show[
          ListPlot3D[data3D],
          ListPointPlot3D[p01],
          Graphics3D@Line@p01,
          ListPointPlot3D[p126],
          Graphics3D@Line@p126
          ]



          enter image description here




          Of course, you can customise the lines/dots as you want with the standard options.
          If you want smooth lines between the points, I would try with interpolating first and then a ParametricPlot:



          p01f[x_] = Interpolation[peakValues01][x];
          p126f[x_] = Interpolation[peakValues126][x];

          htl = Join[{#*[Pi], #*[Pi], {0.014, 0}} & /@
          Range[0, 8, 2], {#*[Pi], "", {0.01, 0}} & /@ Range[0, 8, 1]];

          Show[
          ListPlot3D[data3D, ColorFunction -> "TemperatureMap", Mesh -> None
          , Ticks -> {Automatic, htl, Automatic}, BoxStyle -> Dashed,
          AxesLabel -> {"y", "x"}],
          ListPointPlot3D[p01, PlotStyle -> {Purple}],
          ListPointPlot3D[p126, PlotStyle -> {Blue}],
          ParametricPlot3D[{0.01, x, p01f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
          PlotStyle -> {Purple, Thickness[0.02]}],
          ParametricPlot3D[{1.26, x, p126f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
          PlotStyle -> {Blue, Thickness[0.02]}],
          ViewPoint -> {4, 1, 1}
          ]



          enter image description here







          share|improve this answer











          $endgroup$



          peakValues01 = 
          Pick[yequalto01, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];
          peakValues126 =
          Pick[yequalto126, PeakDetect[yequalto01[[;; , 2]]], 1][[;; -2]];

          p01 = Join[{ConstantArray[0.01, Length[peakValues01]]},
          peakValues01[Transpose]][Transpose];
          p126 = Join[{ConstantArray[1.26, Length[peakValues126]]},
          peakValues126[Transpose]][Transpose];


          Show[
          ListPlot3D[data3D],
          ListPointPlot3D[p01],
          Graphics3D@Line@p01,
          ListPointPlot3D[p126],
          Graphics3D@Line@p126
          ]



          enter image description here




          Of course, you can customise the lines/dots as you want with the standard options.
          If you want smooth lines between the points, I would try with interpolating first and then a ParametricPlot:



          p01f[x_] = Interpolation[peakValues01][x];
          p126f[x_] = Interpolation[peakValues126][x];

          htl = Join[{#*[Pi], #*[Pi], {0.014, 0}} & /@
          Range[0, 8, 2], {#*[Pi], "", {0.01, 0}} & /@ Range[0, 8, 1]];

          Show[
          ListPlot3D[data3D, ColorFunction -> "TemperatureMap", Mesh -> None
          , Ticks -> {Automatic, htl, Automatic}, BoxStyle -> Dashed,
          AxesLabel -> {"y", "x"}],
          ListPointPlot3D[p01, PlotStyle -> {Purple}],
          ListPointPlot3D[p126, PlotStyle -> {Blue}],
          ParametricPlot3D[{0.01, x, p01f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
          PlotStyle -> {Purple, Thickness[0.02]}],
          ParametricPlot3D[{1.26, x, p126f[x]}, {x, 0., 25.1}, {y, 0, 1.26},
          PlotStyle -> {Blue, Thickness[0.02]}],
          ViewPoint -> {4, 1, 1}
          ]



          enter image description here








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 2 days ago

























          answered 2 days ago









          FraccaloFraccalo

          2,9706 silver badges18 bronze badges




          2,9706 silver badges18 bronze badges




























              6












              $begingroup$

              {y01, y126} = Table[Select[data3D, #[[1]] == i &], {i, {.01, 1.26}}];

              {peaks01, peaks126} = Pick[#, PeakDetect[#[[;; , 3]]], 1] & /@ {y01, y126};

              Show[ListPlot3D[data3D],
              Graphics3D[{PointSize[Large], Thick, Red, Line @ peaks01, Point @ peaks01,
              Green, Line @ peaks126, Point@ peaks126}]]


              enter image description here






              share|improve this answer











              $endgroup$




















                6












                $begingroup$

                {y01, y126} = Table[Select[data3D, #[[1]] == i &], {i, {.01, 1.26}}];

                {peaks01, peaks126} = Pick[#, PeakDetect[#[[;; , 3]]], 1] & /@ {y01, y126};

                Show[ListPlot3D[data3D],
                Graphics3D[{PointSize[Large], Thick, Red, Line @ peaks01, Point @ peaks01,
                Green, Line @ peaks126, Point@ peaks126}]]


                enter image description here






                share|improve this answer











                $endgroup$


















                  6












                  6








                  6





                  $begingroup$

                  {y01, y126} = Table[Select[data3D, #[[1]] == i &], {i, {.01, 1.26}}];

                  {peaks01, peaks126} = Pick[#, PeakDetect[#[[;; , 3]]], 1] & /@ {y01, y126};

                  Show[ListPlot3D[data3D],
                  Graphics3D[{PointSize[Large], Thick, Red, Line @ peaks01, Point @ peaks01,
                  Green, Line @ peaks126, Point@ peaks126}]]


                  enter image description here






                  share|improve this answer











                  $endgroup$



                  {y01, y126} = Table[Select[data3D, #[[1]] == i &], {i, {.01, 1.26}}];

                  {peaks01, peaks126} = Pick[#, PeakDetect[#[[;; , 3]]], 1] & /@ {y01, y126};

                  Show[ListPlot3D[data3D],
                  Graphics3D[{PointSize[Large], Thick, Red, Line @ peaks01, Point @ peaks01,
                  Green, Line @ peaks126, Point@ peaks126}]]


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 2 days ago

























                  answered 2 days ago









                  kglrkglr

                  212k10 gold badges243 silver badges486 bronze badges




                  212k10 gold badges243 silver badges486 bronze badges

































                      draft saved

                      draft discarded




















































                      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%2f203890%2fshow-two-plots-together-a-two-dimensional-curve-tangent-to-the-maxima-of-a-thre%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

                      Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                      Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                      Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...