How can I add a diagonal gradient and corresponding colorbar to a plot?

 Accepted Answer

An example:
[X,Y] = meshgrid(1:0.1:3);
Z = X+Y;
pcolor(X,Y,Z)
shading interp
colorbar('Location','NorthOutside')
You can also create your own colormap

More Answers (1)

Hi, colormap's can be used to do so. Look at an example here.

Products

Release

R2019a

Asked:

on 17 Sep 2019

Commented:

on 29 Oct 2019

Community Treasure Hunt

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

Start Hunting!