Plotting on a curved surface

8 visualizaciones (últimos 30 días)
Griffin Polglaze
Griffin Polglaze el 24 de Jul. de 2020
Respondida: Pratheek Punchathody el 31 de Ag. de 2020
This question may be a bit vague but is there anyway to plot these droplets (i.e. the red dots) on a curved surface. All coordinates are in polar form but regarding the plotting surface I'm not sure if there's any way to change it. I have attached a picture of the plot and my code, if anyone is able to suggest any ideas it would be appreciated!
a='.txt';
load('MyColormaps.mat','mycmap');
for i=500
str=int2str(i);
stp= strcat(str,a);
stp
c=load(stp,'w+');
s=size(c)
s1=s(1,1)
s2=s(1,2)
%b=zeros(s1,s1);
b=zeros(500,500);
%S2=sqrt(s1);
%b=zeros(S2,S2);
for ii=1:s1
x(ii,1)=c(ii,1);
y(ii,1)=c(ii,2);
r(ii,1)=c(ii,3);
[radial,theta] = cart2pol(x,y);
end
k=0;
for j=1:s1
if(r(j)>=0.005)
k=k+1;
rnew(k,1)=r(j);
xnew(k,1)=x(j,1);
ynew(k,1)=y(j,1);
[radialnew,thetanew] = cart2pol(xnew,ynew);
end
end
S1=k
for l=1:S1
xo=xnew(l,1);
yo=ynew(l,1);
R=rnew(l,1);
[radialo,thetao] = cart2pol(xo,yo);
for m1=1:1000
m=m1*10/1000;
for n1=1:1000
n=n1*10/1000;
if(((radialo-m)^2+(thetao-n)^2)^0.5)<=R
b(m1,n1)=1;
end
end
end
l
end
figure(i);
bas=figure(i);
imagesc(b);
axis([0 1000 0 160]);
axis square;
colormap(jet);
set(bas,'Colormap',mycmap);
print ('-dtiffn',sprintf('%d.tif',bas));
close all;
end
  3 comentarios
KALYAN ACHARJYA
KALYAN ACHARJYA el 24 de Jul. de 2020
What type of surface plot you are looking for, please see surf , any pictorial representation?
Griffin Polglaze
Griffin Polglaze el 24 de Jul. de 2020
It is a 2D shape i.e. r, theta so I don't think surf will be correct to use

Iniciar sesión para comentar.

Respuestas (1)

Pratheek Punchathody
Pratheek Punchathody el 31 de Ag. de 2020
Hi,
As all the data are in the polar coordinates (i.e. r and theta) the best possible way to visually represent the data is using the polarplot()” which is in the 2D form.
For more reference and enhancements please refer to the documentation of the "polarplot()" .
For customizing the plot please refer to the documentation link here.

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by