Incomplete contour map - Current is not filling the plot
6 次查看(过去 30 天)
显示 更早的评论
clear all
close all
clc
load contour_data.TXT
data = contour_data;
long = data(:,1);
lat = data(:,2);
ba = data(:,3);
figure(1); plot(long, lat, '*k');
n = length(lat);
[X,Y] = meshgrid(linspace(min(long), max(long), n), linspace(min(lat), max(lat), n));
Z = griddata(long, lat, ba, X, Y);
figure(2)
contourf(X, Y, Z);
hold on
plot(long, lat, '.r');
grid
h= colorbar
title(h,'Bouguer anomaly (mgal)')
xlabel('Latitude');
ylabel('Longitude');
title('Bouguer anomaly variation');
%colormap(surf);
% DATA, incase it has not been included:
-4.124347462 52.82254067 -2.414442531
-4.121829386 52.81625525 -2.07190912
-4.119095882 52.81894779 -2.05316106
-4.116335235 52.81772917 -1.169505182
-4.115900384 52.81794375 -1.079339138
-4.113533702 52.81933475 -0.351271015
-4.112325438 52.82012959 0.032004673
-4.111193938 52.82036554 0.683608536
-4.111386301 52.82035313 0.654947439
-4.109294741 52.82038133 1.13485928
-4.108993812 52.81999103 2.601458499
-4.107647756 52.81978115 4.801204286
-4.107111151 52.82034819 5.925406343
-4.106585451 52.82083411 6.608399805
-4.106227717 52.82111023 7.068829607
-4.105947667 52.82115116 7.081235979
-4.104789113 52.82113575 7.796179819
-4.104716695 52.82117301 7.9311538
-4.103943021 52.82052131 8.233178042
-4.103130443 52.82029293 8.471102473
-4.102463576 52.82000801 8.673152696
-4.102197059 52.82002172 8.736696721
-4.101093089 52.81990639 9.144135788
-4.099969193 52.81537628 11.55173962
-4.099562504 52.81987054 9.420156658
-4.099161645 52.81986864 9.666638669
-4.099237964 52.81991225 9.60283148
-4.099502544 52.82047408 9.879058905
-4.098441653 52.82063672 10.1927144
-4.098300704 52.82079207 10.04424085
-4.097271193 52.82099012 10.37724621
-4.096294509 52.82105234 10.4346074
-4.095269438 52.82103448 10.54741082
-4.094030684 52.82089449 10.55380828
-4.092506696 52.82068758 10.71325178
-4.088859062 52.82014938 10.95086924
-4.074187673 52.82531643 11.67943616
-4.073324667 52.82496283 11.96719508
-4.066020099 52.82463164 13.09733926
-4.07383624 52.82417158 11.84273101
-4.074087813 52.82384347 11.18743497
-4.074530488 52.82347605 12.31061911
-4.074598503 52.82303425 11.34996378
-4.074516639 52.82287382 11.48457785
-4.074748507 52.82213242 10.87278665
-4.07403116 52.82140761 10.46084367
-4.072815843 52.82144683 10.56342211
-4.071918823 52.82162436 11.62624915
-4.070843514 52.82211071 10.59852273
-4.06942332 52.82283687 12.18746865
-4.068855548 52.82307158 10.33754713
-4.068855548 52.82307158 10.85594026
-4.068185227 52.82333504 8.770418049
-4.066589518 52.82411817 8.288771725
-4.053847156 52.82022106 3.924714143
-4.053349258 52.81973511 11.37666469
-4.052661535 52.81931539 10.92556862
-4.052431883 52.81885178 10.43691376
-4.050813264 52.81820536 10.79877796
-4.049629814 52.81797403 12.00768717
-4.048634908 52.81796424 11.85617273
-4.047984946 52.81771469 11.35760844
-4.047205887 52.81661312 11.66852885
-4.046762305 52.81633303 11.29025884
-4.043145225 52.8157929 10.44212971
-4.043005435 52.81566043 11.46957275
I am currently creating a contour map for gravity data (Bouguer anomalys), and I cannot seem to fill the entire figure. Hoe do I extrapolate the contours to fill the figure?
I don't want any white areas on my picture.
Hopefully my data has been included
0 个评论
回答(1 个)
Harshit Jain
2019-2-8
编辑:Harshit Jain
2019-2-8
By executing your code I can see that there are many 'NaN' values in the "Z" matrix. Hence, as a result, that points on the contour map are not plotted. You can try replacing 'NaN' values with some finite value and it will work. This link will help.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!