Filled contour plot from data set











up vote
1
down vote

favorite












I want to create a filled contour plot in pgfplot from a dataset mydata.dat



I get a ugly picture like this:



enter image description here



The code that I use is



documentclass{standalone}

usepackage{pgfplots}
usepgfplotslibrary{colorbrewer,patchplots}
pgfplotsset{compat=newest}

pgfplotsset{
colormap={parula}{
rgb255=(53,42,135)
rgb255=(15,92,221)
rgb255=(18,125,216)
rgb255=(7,156,207)
rgb255=(21,177,180)
rgb255=(89,189,140)
rgb255=(165,190,107)
rgb255=(225,185,82)
rgb255=(252,206,46)
rgb255=(249,251,14)}}

begin{document}
begin{tikzpicture}
begin{axis}[
height=9cm,
width=15cm,
view={0}{90},
mesh/ordering=x varies,
mesh/cols=66,
mesh/rows=61,
xtick={1,1.5,2,2.5,3,3.5,4},
colorbar,
ymin=350,
ymax=1000,
point meta min=0.1,
point meta max=30,
colorbar sampled,
colorbar style={ylabel=$z$},
xlabel=$x$,
ylabel=$y$,
shader=interp]
%addplot3[surf] table[x=x, y=y, z=z] {mydata.dat};
%addplot3[contour gnuplot={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};
addplot3[contour filled={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};
end{axis}
end{tikzpicture}
end{document}


What I want is a filled contour plot with "hard edges"
This code gives me such nice hard edged but I do not manage to fill the area between the contours.



addplot3[contour gnuplot={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};


example figure using gnuplot



enter image description here



I have found this tread, which shows how to create a filled contour plot of a function using Asimptote. I have a dataset instead of a function and do not know how to use Asimptote with a dataset.



Can anyone help me with implementing this ?










share|improve this question




























    up vote
    1
    down vote

    favorite












    I want to create a filled contour plot in pgfplot from a dataset mydata.dat



    I get a ugly picture like this:



    enter image description here



    The code that I use is



    documentclass{standalone}

    usepackage{pgfplots}
    usepgfplotslibrary{colorbrewer,patchplots}
    pgfplotsset{compat=newest}

    pgfplotsset{
    colormap={parula}{
    rgb255=(53,42,135)
    rgb255=(15,92,221)
    rgb255=(18,125,216)
    rgb255=(7,156,207)
    rgb255=(21,177,180)
    rgb255=(89,189,140)
    rgb255=(165,190,107)
    rgb255=(225,185,82)
    rgb255=(252,206,46)
    rgb255=(249,251,14)}}

    begin{document}
    begin{tikzpicture}
    begin{axis}[
    height=9cm,
    width=15cm,
    view={0}{90},
    mesh/ordering=x varies,
    mesh/cols=66,
    mesh/rows=61,
    xtick={1,1.5,2,2.5,3,3.5,4},
    colorbar,
    ymin=350,
    ymax=1000,
    point meta min=0.1,
    point meta max=30,
    colorbar sampled,
    colorbar style={ylabel=$z$},
    xlabel=$x$,
    ylabel=$y$,
    shader=interp]
    %addplot3[surf] table[x=x, y=y, z=z] {mydata.dat};
    %addplot3[contour gnuplot={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};
    addplot3[contour filled={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};
    end{axis}
    end{tikzpicture}
    end{document}


    What I want is a filled contour plot with "hard edges"
    This code gives me such nice hard edged but I do not manage to fill the area between the contours.



    addplot3[contour gnuplot={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};


    example figure using gnuplot



    enter image description here



    I have found this tread, which shows how to create a filled contour plot of a function using Asimptote. I have a dataset instead of a function and do not know how to use Asimptote with a dataset.



    Can anyone help me with implementing this ?










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I want to create a filled contour plot in pgfplot from a dataset mydata.dat



      I get a ugly picture like this:



      enter image description here



      The code that I use is



      documentclass{standalone}

      usepackage{pgfplots}
      usepgfplotslibrary{colorbrewer,patchplots}
      pgfplotsset{compat=newest}

      pgfplotsset{
      colormap={parula}{
      rgb255=(53,42,135)
      rgb255=(15,92,221)
      rgb255=(18,125,216)
      rgb255=(7,156,207)
      rgb255=(21,177,180)
      rgb255=(89,189,140)
      rgb255=(165,190,107)
      rgb255=(225,185,82)
      rgb255=(252,206,46)
      rgb255=(249,251,14)}}

      begin{document}
      begin{tikzpicture}
      begin{axis}[
      height=9cm,
      width=15cm,
      view={0}{90},
      mesh/ordering=x varies,
      mesh/cols=66,
      mesh/rows=61,
      xtick={1,1.5,2,2.5,3,3.5,4},
      colorbar,
      ymin=350,
      ymax=1000,
      point meta min=0.1,
      point meta max=30,
      colorbar sampled,
      colorbar style={ylabel=$z$},
      xlabel=$x$,
      ylabel=$y$,
      shader=interp]
      %addplot3[surf] table[x=x, y=y, z=z] {mydata.dat};
      %addplot3[contour gnuplot={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};
      addplot3[contour filled={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};
      end{axis}
      end{tikzpicture}
      end{document}


      What I want is a filled contour plot with "hard edges"
      This code gives me such nice hard edged but I do not manage to fill the area between the contours.



      addplot3[contour gnuplot={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};


      example figure using gnuplot



      enter image description here



      I have found this tread, which shows how to create a filled contour plot of a function using Asimptote. I have a dataset instead of a function and do not know how to use Asimptote with a dataset.



      Can anyone help me with implementing this ?










      share|improve this question















      I want to create a filled contour plot in pgfplot from a dataset mydata.dat



      I get a ugly picture like this:



      enter image description here



      The code that I use is



      documentclass{standalone}

      usepackage{pgfplots}
      usepgfplotslibrary{colorbrewer,patchplots}
      pgfplotsset{compat=newest}

      pgfplotsset{
      colormap={parula}{
      rgb255=(53,42,135)
      rgb255=(15,92,221)
      rgb255=(18,125,216)
      rgb255=(7,156,207)
      rgb255=(21,177,180)
      rgb255=(89,189,140)
      rgb255=(165,190,107)
      rgb255=(225,185,82)
      rgb255=(252,206,46)
      rgb255=(249,251,14)}}

      begin{document}
      begin{tikzpicture}
      begin{axis}[
      height=9cm,
      width=15cm,
      view={0}{90},
      mesh/ordering=x varies,
      mesh/cols=66,
      mesh/rows=61,
      xtick={1,1.5,2,2.5,3,3.5,4},
      colorbar,
      ymin=350,
      ymax=1000,
      point meta min=0.1,
      point meta max=30,
      colorbar sampled,
      colorbar style={ylabel=$z$},
      xlabel=$x$,
      ylabel=$y$,
      shader=interp]
      %addplot3[surf] table[x=x, y=y, z=z] {mydata.dat};
      %addplot3[contour gnuplot={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};
      addplot3[contour filled={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};
      end{axis}
      end{tikzpicture}
      end{document}


      What I want is a filled contour plot with "hard edges"
      This code gives me such nice hard edged but I do not manage to fill the area between the contours.



      addplot3[contour gnuplot={number = 20,labels={false}}] table[x=x, y=y, z=z] {mydata.dat};


      example figure using gnuplot



      enter image description here



      I have found this tread, which shows how to create a filled contour plot of a function using Asimptote. I have a dataset instead of a function and do not know how to use Asimptote with a dataset.



      Can anyone help me with implementing this ?







      asymptote gnuplot contour






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 14 at 17:14

























      asked Nov 9 at 14:19









      jfrans1

      485




      485






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Filling the space between the contour lines is currently unsupported in gnuplot.



          It is possible, however, to draw the contour lines with filled in-between spaces using Asimptote and pgfplot explained in this thread.






          share|improve this answer





















          • Welcome to TeX.SX! Please expand your answer with the information from the other thread.
            – TeXnician
            Nov 9 at 15:48











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          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',
          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%2ftex.stackexchange.com%2fquestions%2f459149%2ffilled-contour-plot-from-data-set%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          Filling the space between the contour lines is currently unsupported in gnuplot.



          It is possible, however, to draw the contour lines with filled in-between spaces using Asimptote and pgfplot explained in this thread.






          share|improve this answer





















          • Welcome to TeX.SX! Please expand your answer with the information from the other thread.
            – TeXnician
            Nov 9 at 15:48















          up vote
          0
          down vote













          Filling the space between the contour lines is currently unsupported in gnuplot.



          It is possible, however, to draw the contour lines with filled in-between spaces using Asimptote and pgfplot explained in this thread.






          share|improve this answer





















          • Welcome to TeX.SX! Please expand your answer with the information from the other thread.
            – TeXnician
            Nov 9 at 15:48













          up vote
          0
          down vote










          up vote
          0
          down vote









          Filling the space between the contour lines is currently unsupported in gnuplot.



          It is possible, however, to draw the contour lines with filled in-between spaces using Asimptote and pgfplot explained in this thread.






          share|improve this answer












          Filling the space between the contour lines is currently unsupported in gnuplot.



          It is possible, however, to draw the contour lines with filled in-between spaces using Asimptote and pgfplot explained in this thread.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 9 at 15:32









          lps

          11




          11












          • Welcome to TeX.SX! Please expand your answer with the information from the other thread.
            – TeXnician
            Nov 9 at 15:48


















          • Welcome to TeX.SX! Please expand your answer with the information from the other thread.
            – TeXnician
            Nov 9 at 15:48
















          Welcome to TeX.SX! Please expand your answer with the information from the other thread.
          – TeXnician
          Nov 9 at 15:48




          Welcome to TeX.SX! Please expand your answer with the information from the other thread.
          – TeXnician
          Nov 9 at 15:48


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459149%2ffilled-contour-plot-from-data-set%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

          How to send String Array data to Server using php in android

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Is anime1.com a legal site for watching anime?