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

6 次查看(过去 30 天)
This is what I'd like to create with my own data, how can I add that gradient and colorbar to my plot

采纳的回答

darova
darova 2019-9-23
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

更多回答(1 个)

Jalaj Gambhir
Jalaj Gambhir 2019-9-20
Hi, colormap's can be used to do so. Look at an example here.

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by