How do I visualize or represent values by its color, using contourf ?

1 view (last 30 days)
Hello everyone, I am trying to plot a color changing 'bar' like diagram. For example, at time t = 1, y=[1 2 3 4 5 6], z=[150 160 170 180 180 160], at time t = 2, y=[1 5 6 7 8 9], z=[140 120 110 100 90 80]. I want to get a 'rainbow' like plot, with x-axis being the time and y-axis being the y values (location), at each y location there is a color index (e.g. a value on the colormap) reflecting the respective z value. So that at higher y value it shows more red and at lower y value it shows more blue on the vertical bar at time t = 1 or t = 2. Hence a gradual change of 'rainbow' colors indicates the change of z values at y location at each time respectively.
At the moment, I use scatter(X,Y,30, Z,'s','filled'). Any better suggestion ?
Thank you very much.
Kind Regards, Jeff

Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!