In need of combination of polarscatter() and scatterhist()

4 visualizaciones (últimos 30 días)
Jan Jaap van Assen
Jan Jaap van Assen el 21 de Oct. de 2022
Editada: Jan Jaap van Assen el 21 de Oct. de 2022
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:
  1. Tweak placement and spacing of subplots
  2. 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:

Respuestas (0)

Categorías

Más información sobre Polar Plots en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by