How do I use m_map in octave

若如初见. 提交于 2019-12-25 01:49:13

问题


I have installed octave on linux ubuntu running as a guest on ubuntu. I am able to plot contours and from http://www2.ocgy.ubc.ca/~rich/map.html#examples. I have also installed m_map and gshhs (both for gmt and for shapefiles, and gmt has been installed). From the instructions on the above site, am not able to link my script (mfile) to the basemap. My script is below

#!/usr/bin/octave

data=load('meansr.txt');
x = data(:,1);
y = data(:,2);

obs = data(:,3);

% create a regular mesh

[xi,yi] = ndgrid(22:0.1:34,-18:0.1:-8);

% number of influential points

m = 29;

% compute the first guess (or background), here we take the mean of all observations

mean_obs = mean(obs);

% remove the mean

f = obs - mean_obs;

% background estimation (here the mean)

var = 0.01 * ones(size(f));

% call optiminterp

[fi,vari] = optiminterp2(x,y,f,var,1.5,1.5,m,xi,yi);

%put back the mean

obsi = fi + mean_obs;

saveas(gcf,'rainzam.pdf'); % This prints to file

% insert basemap

m_proj('mercator','lat',[-18 -8],'lon',[22 34],'aspect',.8);
m_gshhs_i('patch',[.5 .6 .5]);
m_grid('tickdir','out','yaxislocation','left',...
   'xaxislocation','bottom','xlabeldir','middle','ticklen',.02);

These last three lines give errors. I would appreciate advice on how to set up the gshhs_shp directory in relation to m_map, and which paths to change. Currently gshhs_shp directory is in m_map/private.

来源:https://stackoverflow.com/questions/26438895/how-do-i-use-m-map-in-octave

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!