I have climate data that I am plotting in Matlab with a script. The relevant code for this problem, I think, is this:(adsbygoogle = window.adsbygoogle || []).push({});

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:Code (Text):

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,:)];

http://img36.imageshack.us/img36/479/ex1pr.jpg [Broken]

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:Code (Text):

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],:)];

http://img803.imageshack.us/img803/6199/ex2u.jpg [Broken]

Exactly at 2*40, or 80 degrees, it starts doing weird things. Is there a problem in the way I adjusted the code perhaps?

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Problem with graph in Matlab

Loading...

Similar Threads for Problem graph Matlab | Date |
---|---|

Mathematica Graph Plotting Problem in Mathematica | Nov 22, 2016 |

Mathematica graphing problem - twisted plane | Jun 9, 2010 |

Matlab graphing/plotting problem | Mar 13, 2008 |

Matlab graphing/plotting problem | Mar 13, 2008 |

Matlab graphing problem | Oct 16, 2007 |

**Physics Forums - The Fusion of Science and Community**