フィルターのクリア

plotting a set of irregular data points

5 ビュー (過去 30 日間)
Yair
Yair 2019 年 1 月 17 日
コメント済み: Luna 2021 年 1 月 11 日
Hello,
I have a set of data points with columns as follows:
x(cart) | y(cart) | z(cart) | theta (sph) | phi (sph) | Intensity (dB)
cart = cartesian coordinates; sph=spherical coordinates
I want to plot these data points on a 3D plot where x-axis is theta, y-axis is phi, and color is the intensity.
If for example theta has values 0:5:180 degrees and for every theta value there are these phi values 0:10:360 degrees then I can arrange a matrix and use imagesc.
The problem with my set of data points is that the theta and phi values are irregular meaning they are scattered on a sphere. Some data points can have the same theta but different phi, some have same phi but different theta and other points may have unique theta and phi. Like I said, these are points are scattered on a sphere.
Is there any way I can plot these data points so that intensity will be represented by color?
Thank you.

回答 (2 件)

Luna
Luna 2019 年 1 月 17 日
編集済み: Luna 2019 年 1 月 17 日
Hi,
You can use scatter3 function to create a 3D scatter plot.
Check the link: scatter3
For coloring the intensity search for colormap and colorbar.
You can use predefined (Matlab's built-in) colormaps' each row according to your intensity data while looping in scatter. Something like this:
% data
[x, y] = meshgrid(1:100);
z = cos(x).^2 + sin(y).^2;
intensityVector = randi(20,numel(x),1);
c = jet(numel(x)); % create your own colormap here with Mx3 matrix
%xdata,ydata,zdata scatter plot, marker size 10, color is c Matrix
scatter3(x(:),y(:),z(:),10,c);
% define colomap and colorbar according the your colormap
colormap(c);
colorbar;

Saeed Ghanbarifar
Saeed Ghanbarifar 2021 年 1 月 5 日
how can i plot this map in matlab or python ?/
x=lat : utm system
y= long
z= magnetic data
  1 件のコメント
Luna
Luna 2021 年 1 月 11 日
Please use the "ask a question" section on that topic and explain properly what you have and what you need.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by