필터 지우기
필터 지우기

PColor: Why doesn't it work for non-evenly distributed x-vectors?

조회 수: 2 (최근 30일)
Bernadette
Bernadette 2014년 1월 6일
답변: Kelly Kearney 2014년 5월 1일
I have an unevenly distributed x (time) and y vector and a matrix C with size(x,y). When I plot it with pcolor, the plot looks all weird but the y-axis looks fine. Why can it cope with non-evenly distributed y values but not with non-evenly distributed x values? What can I do to solve this?
best regards, Bernadette
  댓글 수: 1
Paul
Paul 2014년 5월 1일
I think this is a problem with pcolor and a time axis rather than unevenly distributed data. I have an evenly distributed matrix of ocean velocity as a function of time (x axis) and depth (y axis). If I use pcolor(time,depth,velocity) the result is similar to yours - the first half of the plot is missing. If I create an artificial x variable (x=1:length(time)) and use pcolor(x,depth,velocity) the plot looks fine.

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

답변 (3개)

Kelly Kearney
Kelly Kearney 2014년 5월 1일
That's the opengl renderer acting up... quick fix:
set(gcf, 'renderer', 'zbuffer');
More complicated fix:

Walter Roberson
Walter Roberson 2014년 1월 6일
Did you try
axis equal
?

Bernadette
Bernadette 2014년 1월 6일
No, unfortunately this doesn't make it better. By writing "axis equal" the plot is somehow shrinked to a small vertical line. But maybe I was not clear enough:
so my code looks like this: pcolor(time,GF,GF_500');
where time is a non-evenly distribted vector GF as well and GF_500 is a matrix with size(GF,time)
unfortunately the graph then looks like this?!

카테고리

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