필터 지우기
필터 지우기

Plotting on a curved surface

조회 수: 4 (최근 30일)
Griffin Polglaze
Griffin Polglaze 2020년 7월 24일
답변: Pratheek Punchathody 2020년 8월 31일
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
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 7월 24일
What type of surface plot you are looking for, please see surf , any pictorial representation?
Griffin Polglaze
Griffin Polglaze 2020년 7월 24일
It is a 2D shape i.e. r, theta so I don't think surf will be correct to use

댓글을 달려면 로그인하십시오.

답변 (1개)

Pratheek Punchathody
Pratheek Punchathody 2020년 8월 31일
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.

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by