- #1
Arjani
- 21
- 1
I have climate data that I am plotting in Matlab with a script. The relevant code for this problem, I think, is this:
The map is divided in a grid of 2.5 degrees each, so the 144 longitude comes out to 360 degrees and the 73 latitude comes out to 182.5 degrees. I guess the latitude has one degree overlap. Using these values, I get a plot such as this:
http://img36.imageshack.us/img36/479/ex1pr.jpg
But this isn't what I need, what I need is to plot a band of ±40 degrees (using different data) around the equator. So, I adjust the code to these values:
Changes emphasized. It works somewhat, but the graph becomes screwed up:
http://img803.imageshack.us/img803/6199/ex2u.jpg
Exactly at 2*40, or 80 degrees, it starts doing weird things. Is there a problem in the way I adjusted the code perhaps?
Code:
lon = reshape(grid_txt_lon,144,73);
lon(lon>180) = lon(lon>180) - 360;
lon = [lon(74:144,:);lon(1:73,:)];
lat = reshape(grid_txt_lat,144,73);
deg = reshape(degree,144,73);
deg = [deg(74:144,:);deg(1:73,:)];
The map is divided in a grid of 2.5 degrees each, so the 144 longitude comes out to 360 degrees and the 73 latitude comes out to 182.5 degrees. I guess the latitude has one degree overlap. Using these values, I get a plot such as this:
http://img36.imageshack.us/img36/479/ex1pr.jpg
But this isn't what I need, what I need is to plot a band of ±40 degrees (using different data) around the equator. So, I adjust the code to these values:
Code:
lon = reshape(grid_txt_lon,144,[B][U]33[/U][/B]);
lon(lon>180) = lon(lon>180) - 360;
lon = [lon([B][U]34[/U][/B]:144,:);lon(1:[B][U]33[/U][/B],:)];
lat = reshape(grid_txt_lat,144,[B][U]33[/U][/B]);
deg = reshape(degree,144,[B][U]33[/U][/B]);
deg = [deg([B][U]34[/U][/B]:144,:);deg(1:[B][U]33[/U][/B],:)];
Changes emphasized. It works somewhat, but the graph becomes screwed up:
http://img803.imageshack.us/img803/6199/ex2u.jpg
Exactly at 2*40, or 80 degrees, it starts doing weird things. Is there a problem in the way I adjusted the code perhaps?
Last edited by a moderator: