How do I plot three variables against each other?
1 回表示 (過去 30 日間)
古いコメントを表示
I have a list of lightning flahses, each flash has a latitude, longitude, and a power. All three of these are lists, not matrices.
I would like to plot a 3D plot, where x is longitude, y is latitude, and each dot is color coded to represent its power at the latitude and longitudinal locations.
How do I do this using three lists? The 3d plotting functions, like imagesc, require a matrix as the third value.
Thanks!
0 件のコメント
採用された回答
Star Strider
2019 年 6 月 28 日
Try this:
lat = rand(10,1); % Create Vector
lon = rand(10,1); % Create Vector
power = randi(9,10,1); % Create Vector
figure
scatter3(lat(:), lon(:), power(:), [], power(:), 'filled')
grid on
This will colour them by the ’Z’ (’power’) value. The fourth argument [] is the size reference, and since you may want them all the same size, that argument is the empty array.
6 件のコメント
Star Strider
2019 年 6 月 28 日
I have no idea what the problem could be.
I would need at least a representative sample of your data to see what the problem is (assuming I could reproduce it).
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!