In need of combination of polarscatter() and scatterhist()
4 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I’m trying to make a polarscatter plot where histograms on the x and y axis show the local density as there are many datapoints (~32 million). Polarscatter() works perfectly but has no option to add the histograms. Scatterhist() seems to do exactly what I need but doesn’t seem to work for polar plots. I’m now working with subplots but alignment is a complete mess. How would you solve this? I think of two options:
- Tweak placement and spacing of subplots
- Use scatterhist() and make it work with polar coordinates.
Any suggestions are really appreciated. I’m using Matlab 2020a.
Here is the current code:
figure
subplot(2,2,1)
polarscatter(angle,radius,sz,color,'.')
rlim([0 maxrad])
pax = gca;
pax.ThetaTickLabel = string(pax.ThetaTickLabel) + char(176); % add degree sign
hold on
sz = 25;
polarscatter(mean(angle),mean(radius),sz,'k','+')
hold off
subplot(2,2,2)
area(x,binV)
xlim([-maxrad maxrad])
ylim([0 yMax])
camroll(-90)
pbaspect([3 1 1])
set(gca,'YTickLabel',[]);
subplot(2,2,3)
area(x,binU)
xlim([-maxrad maxrad])
ylim([0 yMax])
set(gca,'YDir','reverse');
pbaspect([3 1 1])
set(gca,'YTickLabel',[]);
Here is the output plot:
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!