Filling an area below a curve with a colormap defined by the function of the curvehow to get vertical gradient fill in matlab plotPlot Shaded Area Between Two User-Defined Lines and Beneath Preexisting DataMatlab: contourf or colormap to plot filled ellipses according to radiusMatlab Area Plot: Adjusting box style and tick marksHow do I plot one curve with two different units (y-axes) in the same plot window in MATLAB?How to shade area between horizontal line and curve in Matlab plotArea between line and curve (no function)Matlab - try to get the same curve with Matlab numerical function and ezplotPyhon - Fill under curve, based on the value of the functionPython Matplotlib - Filling Area Between Two Concentric Circles

Joist hangers to use for rough cut 2x8 (2 3/4" x 8 3/4")?

Asking bank to reduce APR instead of increasing credit limit

What is the intuition behind uniform continuity?

What is a simple, physical situation where complex numbers emerge naturally?

How can I offer a test ride while selling a bike?

Singlequote and backslash

How can I grammatically understand "Wir über uns"?

What does it mean by "d-ism of Leibniz" and "dotage of Newton" in simple English?

The oldest tradition stopped before it got back to him

Beginner's snake game using PyGame

Select row of data if next row contains zero

The most awesome army: 80 men left and 81 returned. Is it true?

What is a natural deduction proof from ~(A↔B) to ~(A→B)?

Are there regional foods in Westeros?

How to decline physical affection from a child whose parents are pressuring them?

Did airlines fly their aircraft slower in response to oil prices in the 1970s?

What does the behaviour of water on the skin of an aircraft in flight tell us?

What should I do about a religious player who refuses to accept the existence of multiple gods in D&D?

Do adult Russians normally hand-write Cyrillic as cursive or as block letters?

Modern approach to radio buttons

Why would Lupin kill Pettigrew?

How can an eldritch abomination hide its true form in public?

Looking after a wayward brother in mother's will

Is the world in Game of Thrones spherical or flat?



Filling an area below a curve with a colormap defined by the function of the curve


how to get vertical gradient fill in matlab plotPlot Shaded Area Between Two User-Defined Lines and Beneath Preexisting DataMatlab: contourf or colormap to plot filled ellipses according to radiusMatlab Area Plot: Adjusting box style and tick marksHow do I plot one curve with two different units (y-axes) in the same plot window in MATLAB?How to shade area between horizontal line and curve in Matlab plotArea between line and curve (no function)Matlab - try to get the same curve with Matlab numerical function and ezplotPyhon - Fill under curve, based on the value of the functionPython Matplotlib - Filling Area Between Two Concentric Circles






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Consider the following plot:



enter image description here



On the left you can see the fill of a circle with respect to a profile of a function using patch command



t = linspace(-pi,pi,100);
c = exp(-cos(t));
figure(1)
patch(cos(t),sin(t),c)
axis equal


On the right you see the profile of the function along the dashed line axis on the left, which is filled using the area command.



figure(2)
area(cos(t),c,0);


what I'm trying to do is fill the area below the curve (right panel) with the colors defined by the colormap of the representation in the left panel. The results should look like this
enter image description here










share|improve this question






























    0















    Consider the following plot:



    enter image description here



    On the left you can see the fill of a circle with respect to a profile of a function using patch command



    t = linspace(-pi,pi,100);
    c = exp(-cos(t));
    figure(1)
    patch(cos(t),sin(t),c)
    axis equal


    On the right you see the profile of the function along the dashed line axis on the left, which is filled using the area command.



    figure(2)
    area(cos(t),c,0);


    what I'm trying to do is fill the area below the curve (right panel) with the colors defined by the colormap of the representation in the left panel. The results should look like this
    enter image description here










    share|improve this question


























      0












      0








      0








      Consider the following plot:



      enter image description here



      On the left you can see the fill of a circle with respect to a profile of a function using patch command



      t = linspace(-pi,pi,100);
      c = exp(-cos(t));
      figure(1)
      patch(cos(t),sin(t),c)
      axis equal


      On the right you see the profile of the function along the dashed line axis on the left, which is filled using the area command.



      figure(2)
      area(cos(t),c,0);


      what I'm trying to do is fill the area below the curve (right panel) with the colors defined by the colormap of the representation in the left panel. The results should look like this
      enter image description here










      share|improve this question
















      Consider the following plot:



      enter image description here



      On the left you can see the fill of a circle with respect to a profile of a function using patch command



      t = linspace(-pi,pi,100);
      c = exp(-cos(t));
      figure(1)
      patch(cos(t),sin(t),c)
      axis equal


      On the right you see the profile of the function along the dashed line axis on the left, which is filled using the area command.



      figure(2)
      area(cos(t),c,0);


      what I'm trying to do is fill the area below the curve (right panel) with the colors defined by the colormap of the representation in the left panel. The results should look like this
      enter image description here







      matlab plot colors matlab-figure area






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 13:17









      Dev-iL

      18.4k64579




      18.4k64579










      asked Mar 24 at 10:44









      jarheadjarhead

      62541436




      62541436






















          1 Answer
          1






          active

          oldest

          votes


















          1














          The closest thing I could come up with is this:



          function q55322965
          % Evaluate the equation (half domain!)
          t = linspace(-pi,0,50);
          c = exp(-cos(t));

          % Turn vectors into a mesh:
          [TT,CC] = meshgrid(cos(t),c);

          % Clear all points that are above the curve:
          CC(CC > c) = NaN;

          % Fill in the rectangle between the chart and zero:
          CC(end+1,:) = 0;
          TT(end+1,:) = TT(end,:);

          % Plot:
          figure(); mesh(TT,CC,CC,'FaceColor','interp','EdgeColor','interp'); view([0,90]);


          Which yields:



          enter image description here



          If you want a less jagged look when plotting with this method, you can increase the resolution in t. For example, if we use 500 instead of 50 in the linspace we get:



          enter image description here






          share|improve this answer

























          • why did you choose only half of the domain and not the full range [-pi,pi]?

            – jarhead
            Mar 24 at 15:16











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2fstackoverflow.com%2fquestions%2f55322965%2ffilling-an-area-below-a-curve-with-a-colormap-defined-by-the-function-of-the-cur%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









          1














          The closest thing I could come up with is this:



          function q55322965
          % Evaluate the equation (half domain!)
          t = linspace(-pi,0,50);
          c = exp(-cos(t));

          % Turn vectors into a mesh:
          [TT,CC] = meshgrid(cos(t),c);

          % Clear all points that are above the curve:
          CC(CC > c) = NaN;

          % Fill in the rectangle between the chart and zero:
          CC(end+1,:) = 0;
          TT(end+1,:) = TT(end,:);

          % Plot:
          figure(); mesh(TT,CC,CC,'FaceColor','interp','EdgeColor','interp'); view([0,90]);


          Which yields:



          enter image description here



          If you want a less jagged look when plotting with this method, you can increase the resolution in t. For example, if we use 500 instead of 50 in the linspace we get:



          enter image description here






          share|improve this answer

























          • why did you choose only half of the domain and not the full range [-pi,pi]?

            – jarhead
            Mar 24 at 15:16















          1














          The closest thing I could come up with is this:



          function q55322965
          % Evaluate the equation (half domain!)
          t = linspace(-pi,0,50);
          c = exp(-cos(t));

          % Turn vectors into a mesh:
          [TT,CC] = meshgrid(cos(t),c);

          % Clear all points that are above the curve:
          CC(CC > c) = NaN;

          % Fill in the rectangle between the chart and zero:
          CC(end+1,:) = 0;
          TT(end+1,:) = TT(end,:);

          % Plot:
          figure(); mesh(TT,CC,CC,'FaceColor','interp','EdgeColor','interp'); view([0,90]);


          Which yields:



          enter image description here



          If you want a less jagged look when plotting with this method, you can increase the resolution in t. For example, if we use 500 instead of 50 in the linspace we get:



          enter image description here






          share|improve this answer

























          • why did you choose only half of the domain and not the full range [-pi,pi]?

            – jarhead
            Mar 24 at 15:16













          1












          1








          1







          The closest thing I could come up with is this:



          function q55322965
          % Evaluate the equation (half domain!)
          t = linspace(-pi,0,50);
          c = exp(-cos(t));

          % Turn vectors into a mesh:
          [TT,CC] = meshgrid(cos(t),c);

          % Clear all points that are above the curve:
          CC(CC > c) = NaN;

          % Fill in the rectangle between the chart and zero:
          CC(end+1,:) = 0;
          TT(end+1,:) = TT(end,:);

          % Plot:
          figure(); mesh(TT,CC,CC,'FaceColor','interp','EdgeColor','interp'); view([0,90]);


          Which yields:



          enter image description here



          If you want a less jagged look when plotting with this method, you can increase the resolution in t. For example, if we use 500 instead of 50 in the linspace we get:



          enter image description here






          share|improve this answer















          The closest thing I could come up with is this:



          function q55322965
          % Evaluate the equation (half domain!)
          t = linspace(-pi,0,50);
          c = exp(-cos(t));

          % Turn vectors into a mesh:
          [TT,CC] = meshgrid(cos(t),c);

          % Clear all points that are above the curve:
          CC(CC > c) = NaN;

          % Fill in the rectangle between the chart and zero:
          CC(end+1,:) = 0;
          TT(end+1,:) = TT(end,:);

          % Plot:
          figure(); mesh(TT,CC,CC,'FaceColor','interp','EdgeColor','interp'); view([0,90]);


          Which yields:



          enter image description here



          If you want a less jagged look when plotting with this method, you can increase the resolution in t. For example, if we use 500 instead of 50 in the linspace we get:



          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 24 at 13:13

























          answered Mar 24 at 12:55









          Dev-iLDev-iL

          18.4k64579




          18.4k64579












          • why did you choose only half of the domain and not the full range [-pi,pi]?

            – jarhead
            Mar 24 at 15:16

















          • why did you choose only half of the domain and not the full range [-pi,pi]?

            – jarhead
            Mar 24 at 15:16
















          why did you choose only half of the domain and not the full range [-pi,pi]?

          – jarhead
          Mar 24 at 15:16





          why did you choose only half of the domain and not the full range [-pi,pi]?

          – jarhead
          Mar 24 at 15:16

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


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

          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%2fstackoverflow.com%2fquestions%2f55322965%2ffilling-an-area-below-a-curve-with-a-colormap-defined-by-the-function-of-the-cur%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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현