matlab热度图确定色标_MATLAB 颜色图函数(imagesc/scatter/polarPcolor/pcolor)

2维的热度图 imagesc

imagesc(x, y, z),x和y分别是横纵坐标,z为值,表示颜色

imagesc(theta,phi,slc); colorbar

xlabel('theta(°)','fontname','Times New Roman','FontSize',14);

ylabel('phi(°)','fontname','Times New Roman','FontSize',14);

sta = '3 objects at (θ,φ,r) : (-30,30,1) (0,0,2) (60,-60,0.5)';

str=sprintf(strcat('3D Imaging Slice at :', num2str(d_max*D/N), '(m)', '\n',sta));

title(str, 'fontname','Times New Roman','Color','k','FontSize',13);

grid on

其中,colorbar的坐标值调整:caxis([0 1]);

colormap的色系调整:colormap hot

3维散点图 scatter

scatter3(x,y,z,24,c,'filled');

% axis([-(R+2) (R+2) -(R+2) (R+2) 0 (h+2)]);

colorbar

2维 极坐标热度图 polarPcolor

polarPcolor(R_axis, theta, value),前两个为半径方向坐标轴和圆心角坐标轴,value为值,用颜色表示

[fig, clr] = polarPcolor(R_axis, theta, x_d_th, 'labelR','range (m)','Ncircles', 5,'Nspokes',7);

colormap hot

% caxis([0 1]);

其中polarPcolor代码如下:

function [varargout] = polarPcolor(R,theta,Z,varargin)

% [h,c] = polarPcolor1(R,theta,Z,varargin) is a pseudocolor plot of matrix

% Z for a vector radius R and a vector angle theta.

% The elements of Z specify the color in each cell of the

% plot. The goal is to apply pcolor function with a polar grid, which

% provides a better visualization than a cartesian grid.

%

%% Syntax

%

% [h,c] = polarPcolor(R,theta,Z)

% [h,c] = polarPcolor(R,theta,Z,'Ncircles',10)

% [h,c] = polarPcolor(R,theta,Z,'Nspokes',5)

% [h,c] = polarPcolor(R,theta,Z,'Nspokes',5,'colBar',0)

% [h,c] = polarPcolor(R,theta,Z,'Nspokes',5,'labelR','r (km)')

%

% INPUT

% * R :

% - type: float

% - size: [1 x Nrr ] where Nrr = numel(R).

% - dimension: radial distance.

% * theta :

% - type: float

% - size: [1 x Ntheta ] where Ntheta = numel(theta).

% - dimension: azimuth

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值