필터 지우기
필터 지우기

How to plot bar chart with color gradient ?

조회 수: 10 (최근 30일)
Teerapong Poltue
Teerapong Poltue 2021년 2월 1일
답변: Image Analyst 2021년 2월 1일
I would like to plot a bar chart with a color gradient as its value change color must be change. How can I do that.
For example
data = [1.4 2.1 3.3 4.5 5.4];
c = [0.3 0.4 0.5 0.6 0.7];
I would like to have a single bar plot from 1.4 to 5.4, and each point on that bar chart has their own color based on the value in c array.
How can I do that ?
What I mean is forming graph from this equation
Z = (0.51019.*X)-Y;
gradient color is Z value.
x range of bar graph is the X value.
And each bar represent constant Y value in that equation.

답변 (1개)

Image Analyst
Image Analyst 2021년 2월 1일
See my attached demo and adapt as needed.

카테고리

Help CenterFile Exchange에서 Bar Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by