필터 지우기
필터 지우기

Adding background image to a Pcolor plot.

조회 수: 4 (최근 30일)
Al Onen
Al Onen 2011년 2월 7일
Hello,
Firstly I should say that I've seen similar questions like this one here, but couldn't actually manage to solve my question.
I need a pcolor-overlayed image like this one: http://www.mapwatch.com/gallery/cumulative-rainfall-map.gif
But I only need the black minor borders (white thick state border overlay not needed).
Assume that I have a image having borders like above called "map.jpg".
And I have my distribution pcolor plot called "P".
I tried to change Pcolor plot's transparecy with FaceAlpha, and putting my image on background (I tried this http://www.mathworks.com/support/solutions/en/data/1-19J7T/ ).
Plot transparency worked, but I couldn't combine it with the image.
Any help is much appreciated.
Thanks in advance.
Al

답변 (3개)

Al Onen
Al Onen 2011년 2월 15일
I'm still in need of some guidance.

Walter Roberson
Walter Roberson 2011년 2월 7일
To check, are you sure you want pcolor() and not image() or imagesc() ? pcolor applied to an NxM matrix outputs (N-1) x (M-1) squares.
Could you show the section of code you use to try to do the combining operation?

Al Onen
Al Onen 2011년 2월 7일
Yes, I need to use pcolor. I have geographical data as X, Y and rainfall data as Z on pcolor. Here is the basic code I use. I know it's nowhere near what I need, I'm very amateur on Matlab.
P=pcolor(Lat,Long,Rain);
set(P,'facecolor', 'interp', 'FaceAlpha',0.5);
shading interp;
ha = axes('units','normalized','position',[0 0 1 1]);
uistack(ha,'bottom');
I=imread('map.jpg');
hi = imagesc(I);
set(ha,'handlevisibility','off','visible','off');
Also the link below shows the output figure of the code. What I need is to make map visible behind the main pcolor plot. It would be cool if you can also help keeping the map inside the borders of the main figure, not exceeding to the blank background.
Thanks very very much in advance.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by