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