I would like to do geobubble plot over Indian landmass. I follow the following link to create my bubble plot:https​://in.math​works.com/​help/matla​b/ref/geob​ubble.html​. I would like to do the same plot over the shape file of world and India.

조회 수: 3 (최근 30일)
stationwisecorrS2 = readtable('station_wisecorr.xlsx');

채택된 답변

Subhadeep Koley
Subhadeep Koley 2020년 1월 17일
Hi, refer the code below which plots geobubble over india shape file (use the attached zip file for the .shp files).
clear all; close all; clc;
opts = spreadsheetImportOptions("NumVariables", 7);
% Specify sheet and range
opts.Sheet = "Sheet1";
opts.DataRange = "A3:G10";
% Specify column names and types
opts.VariableNames = ["Latitude", "Longitude", "Location", "R", "MABE", "RMSE", "Correlation"];
opts.SelectedVariableNames = ["Latitude", "Longitude", "Location", "R", "MABE", "RMSE", "Correlation"];
opts.VariableTypes = ["double", "double", "string", "double", "double", "double", "categorical"];
opts = setvaropts(opts, 3, "WhitespaceRule", "preserve");
opts = setvaropts(opts, [3, 7], "EmptyFieldRule", "auto");
% Import the data
stationwisecorr = readtable("C:\Users\skoley\Downloads\station_wisecorr.xlsx", opts, "UseExcel", false);
% Convert to categorical
stationwisecorr.Correlation = categorical(stationwisecorr.Correlation);
% Plot geobubble
han = figure;
gb = geobubble(han,stationwisecorr, 'Latitude', 'Longitude',...
'SizeVariable', 'MABE', 'ColorVariable', 'Correlation',...
'Title', 'Comparison between the two datasets', 'Basemap', 'none');
% Set geolimits
geolimits(gb, [6 40], [65 98]);
% Read the .shp file
S = shaperead('INDIA.shp');
% Plot the map
ax = axes(han, 'Units', 'Normalize', 'Position', get(gb, 'Position'));
mapshow(ax, S);
% set transparency and visibility
alpha(ax, 0.2);
ax.Visible = 'off';
% Set limits
axis(ax, [65 98 6 42.5]);
indiaMap.png
Hope this helps!

추가 답변 (1개)

Cris LaPierre
Cris LaPierre 2019년 12월 29일
I think you are saying you want to include more of the world in the map. Is that correct?
The line of code that starts with geolimits is what is setting how much of the map you see. Modify the values there to change how much of the world is included in your geoscatter plot.
  댓글 수: 1
Sushovan Ghosh
Sushovan Ghosh 2019년 12월 30일
I would like to do the bubble plot over the india shape file instead of doing over any geobasemap . I am only interested over India that is the reason I set the geolimits.
looking for your help & suggestion.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by