Faded color under area of curve

조회 수: 8 (최근 30일)
Brett Kemman
Brett Kemman 2019년 9월 13일
답변: Raunak Gupta 2019년 9월 16일
Is there a way to fade the color under the area of a curve? For example, in an increasing plot that starts at 1 the area beneath the curve is white and as the curve increases to 100 it becomes a dark blue.
I'm aware of the area(x,y) function, but that just gives me a solid color.
  댓글 수: 1
Johannes Fischer
Johannes Fischer 2019년 9월 13일
I think this solution by Patrick Kalita should apply to your question as well:
Depending on you application you might want to increase the number of colors on the colormap, e.g. adding
colormap(parula(256))
at the end.

댓글을 달려면 로그인하십시오.

답변 (1개)

Raunak Gupta
Raunak Gupta 2019년 9월 16일
Hi,
There is a similar answer which may be of revelance to you : https://www.mathworks.com/matlabcentral/answers/1387-area-plot-with-gradient.
For Linearly increasing the color as you mentioned from 1 to 100, You can use M(x) = x.
Hope this helps.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by