matlab use m_map Kit draw a map of China and scatter cloud

Need to be ready malab, China Map shp file, m_map toolkit before you start.

China Map shp file can be downloaded at the following link:

https://gadm.org/download_country_v3.html

This article draws on the tutorial link below, which is a matlab package comes with drawing tools to draw method, in order to run on my computer geoshow particularly long time, I do not know why, interested students can try:

https://my.oschina.net/chengwei426/blog/674280

Draw a map of China use m_map, code is as follows:

All use Close, the Clear All, CLC, IF error dbstop
the FPNI = 'C: \ the Users \ ZZL \ Desktop \ Python \ gadm36_CHN_shp \ gadm36_CHN_1.shp';% China Map shp file path where
China = shaperead (the FPNI);
Boux = [China . (:) X]; bouy = [China (:) Y];.% , respectively, is to obtain the latitude and longitude information X Y information
set (gcf, 'position', [0 0 1440 780]);% set position of the graphics window and size
m_proj ( 'Mercator', 'lon ', [103 121], 'lat', [19 31]);% to set the projection: Mercator, the map display range
m_plot (boux, bouy, 'k ') ;% most critical one, mapping
% following sentence pattern disposed horizontal and vertical coordinates latitude and longitude format
m_grid ( 'linestyle', 'none ', 'linewidth', 2, 'tickdir', 'out', 'xaxisloc', ' bottom ',' yaxisloc ',' left ',' fontsize ', 12);

So far, the mapping is completed. The following is drawn above the map on the basis of plotted point cloud according to latitude and longitude coordinates scatter, assuming there are three data, as shown in FIG.

 

 Wherein the first as longitude, latitude as the second, the third value as the corresponding point (the population may be, may be the altitude ...).

Following the above code, the code scattergram as follows:

ON HOLD;
Load corrcoef.mat;% loading of discrete data
LON = CocE (:,. 1); CocE LAT = (:, 2); DATACO CocE = (:,. 3);
m_scatter (LON, LAT, 80, DATACO, 'filled', 'MarkerFaceColor', 'flat', 'MarkerEdgeColor', 'w', 'linewi', 1);% Videos filled dots in FIG
% m_scatter (lon, lat, 50 , dataco, 'MarkerFaceColor', w ', 'linewi', 2);% hollow point Videos FIG
contourcmap ( 'jet', [-1 : 0.1: 1], 'colorbar', 'on', 'location', 'vertical', 'fontsize', 13); % display legend
title ( '***', 'Rotation ', 0, 'FontSize', 14);% showing title

Graphics are as follows:

 

 

 

 Thus, the purpose of this paper is complete, I deal with basic data by matlab, but also use it to paint the first time, has been in use before sufer draw, the main problem is to adjust the graphics more trouble, and when graphing too much, more cumbersome and error-prone, and therefore decided to use matlab plot, it took two days before from a zero base to draw the graph above. Here are some basic examples m_map kit, hereby reproduced at the following link:

https://www.cnblogs.com/ruo-li-suo-yi/p/7663498.html

 

Guess you like

Origin www.cnblogs.com/righdflf/p/11484189.html