From: Nicholas Bawden on 12 Jul 2010 20:47 So I have imported my own coastline and created my picture using m_map. Everything shows up including all my labels, except it's not creating any contour lines for me. [lon,lat]=meshgrid([-88.6:2:-87.6],[29.0:2:31.0]); EDU>> m_proj('UTM','longitudes',[-88.6 -87.6],'latitudes',[29.0 31.0],'zone',[16],'hemisphere',[0],'ellipsoid',0,'rectangular border','on'); m_ungrid m_line(mobilebay(:,1),mobilebay(:,2)); m_grid('xlabeldir','end','ylabeldir','end','fontsize',12); EDU>> hold on; EDU>> [cs,h]=m_contour(lon,lat,z,XI,YI); clabel(cs,h,'fontsize',8); z is the list of measurements I am trying to plot contours of XI and YI are the corresponding long/lat for the measurements I want to create contours from Any help in what I am doing wrong would be greatly appreciated.
From: TideMan on 12 Jul 2010 22:30 On Jul 13, 12:47 pm, "Nicholas Bawden" <n_bawd...(a)yahoo.com> wrote: > So I have imported my own coastline and created my picture using m_map. Everything shows up including all my labels, except it's not creating any contour lines for me. > > [lon,lat]=meshgrid([-88.6:2:-87.6],[29.0:2:31.0]); > EDU>> m_proj('UTM','longitudes',[-88.6 -87.6],'latitudes',[29.0 31.0],'zone',[16],'hemisphere',[0],'ellipsoid',0,'rectangular border','on'); > m_ungrid > > m_line(mobilebay(:,1),mobilebay(:,2)); > m_grid('xlabeldir','end','ylabeldir','end','fontsize',12); > > EDU>> hold on; > EDU>> [cs,h]=m_contour(lon,lat,z,XI,YI); > clabel(cs,h,'fontsize',8); > > z is the list of measurements I am trying to plot contours of > XI and YI are the corresponding long/lat for the measurements I want to create contours from > > Any help in what I am doing wrong would be greatly appreciated. mmmmm................... I have never used m_ungrid. Why do you use it? I always call m_grid after plotting everything else. What are XI,YI in m_contour? By my reckoning it should have only 4 arguments, with the last being the the number of contours or a vector of levels. Strip everything away except: m_proj m_contour m_grid and see if that works.
From: Nicholas Bawden on 12 Jul 2010 23:04 XI and YI are the lat and long coordinates associated with the values in z. I am trying to get it to draw the contours based on the locations of the values I have. I tried what you said but I just got errors.
From: TideMan on 12 Jul 2010 23:27 On Jul 13, 3:04 pm, "Nicholas Bawden" <n_bawd...(a)yahoo.com> wrote: > XI and YI are the lat and long coordinates associated with the values in z. I am trying to get it to draw the contours based on the locations of the values I have. > > I tried what you said but I just got errors. Your problem is not with m_map, but with basic understanding of how contour works. You have generated a mesh using meshgrid, but now you have to determine a value for z for each of the points in that mesh. You do this using griddata. You are combining the steps of griddata and contour, but AFAIK, you cannot do that. They are separate steps. First, you generate z using gridata; Then you plot those data using contour or m_contour Forget about m_map for the moment and try to get things working using contour. Once that works, it will be easy to make the plot pretty by using m_map.
From: Nicholas Bawden on 12 Jul 2010 23:40 Thanks for pointing me in the right direction. I appreciate the help.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: An exact 1-D integration challenge - 65 - (sqrt, cos) Next: timer function |