채택된 답변

Image Analyst
Image Analyst 2012년 9월 27일

0 개 추천

pcolor can do circular maps. But what does your angular dimension represent, and why is that representation any better than a rectangular representation (a rectangular image)?

댓글 수: 7

Razvan
Razvan 2012년 9월 27일
편집: Razvan 2012년 9월 27일
Thank you! In the example images the angle represents the genomic location, along 5 chromosomes. I guess the only advantage is that they can fit in a smaller space (at least on the horizontal direction). But they look nice :)
Any idea how I can disable the black lines that mark each cell in the pcolor plot? I tried something like this in order to plot a track:
n = 500;
r = [0.8; 1];
theta = pi*(-n:0.8*n)/n;
X = r*cos(theta);
Y = r*sin(theta);
C = r*cos(2*theta);
pcolor(X,Y,C)
axis equal tight
If the tracks are too long (and they will be if they represent genomic locations), then the black lines make the plot indistinguishable. Also how can you add tick marks and labels to this?
Thanks again,
Razvan
You can set edgecolor = 'none' to get rid of the little black lines around the tiles:
[X,Y,Z] = peaks(30);
hs = pcolor(X,Y,Z+10);
set(hs, 'edgecolor', 'none')
Razvan
Razvan 2012년 9월 28일
Thank you. What about the ticks and labels around the circular plot from my example? Is there an easy way to do this?
Image Analyst
Image Analyst 2012년 9월 28일
I don't use pcolor much at all because of its problems and deceptive nature. But in general you can use set() to set various properties of anything in MATLAB. Look up what kind of thing you want to set properties of: axes, figure, etc.
Thanks. I remembered that I can get all the properties by a simple
get(someHandle)
and I can start to play with all those properties :)
One more thing: Is it possible to plot a normal function (not heat map) in a circular track, like the outer track from my first example picture? Or in other words can I bend the axes of a normal plot command along a circle in Matlab?
I can start a new Question/Thread if necessary...
Image Analyst
Image Analyst 2012년 9월 28일
If you have a 2D array of data, you can use cart2pol() to change it, but I haven't really played around with that so I'm no expert on that.
Razvan
Razvan 2012년 9월 28일
That only translates the coordinates from Cartesian to polar (or cylindrical for 3d data), but doesn't really bend the horizontal plot into a circular plot. Thanks anyway.

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

추가 답변 (1개)

Christian Günther
Christian Günther 2022년 5월 16일
편집: Christian Günther 2022년 5월 16일

0 개 추천

Hello,
You can transform the Data to cartesian coordinates and use the hist3 function instead.
%polar(t,r,'+')
x = r.*cos(t);
y = r.*sin(t);
data = [x',y'];
hh3 = hist3(data, 'Nbins',[1 1]*25);
figure
image(flipud(hh3))
ax = gca;
xt = ax.XTick;
yt = ax.YTick;
ax.XTickLabel = xt*10;
set(ax, 'YTick',[0 yt], 'YTickLabel', [flip([0 yt])]*10)

카테고리

질문:

2012년 9월 27일

편집:

2022년 5월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by