I am plotting some geo points of some towers and its coverage area, i want to know how i can specify the color and size and shape of the main tower(as i have 8 towers to plot but on the same output) and area it covers with the same color.

4 件のコメント

Dyuman Joshi
Dyuman Joshi 2023 年 9 月 24 日
Depending upon the type of data you have, you can use geoplot, geoplot (both are different functions), fillm and other options.
Can you share the data and the code you are working with?
Sangesh Pv
Sangesh Pv 2023 年 9 月 24 日
coverage = readtable('subtower.csv');
coverage = geoscatter(coverage,"Latitude","Longitude","filled");
coverage.ColorVariable = "subtower";
c = colorbar;
c.Label.String = "Positon of coverage of main Towers";
for example my data is like this
and it responds to the main tower 66317, second tower 69017 and etc for total of 8 towers and the it cowers a specific area each tower i want each of the main towers (66317 ..etc) to have a different shape and size and the covered areas of that specific towers to be same color.
Dyuman Joshi
Dyuman Joshi 2023 年 9 月 24 日
"i want each of the main towers (66317 ..etc) to have a different shape and size"
The shape and size of each area will be according to the data you have.
Can you attach the data i.e. the csv file? Use the paperclip button to attach.
Sangesh Pv
Sangesh Pv 2023 年 9 月 24 日
the files are attached below

サインインしてコメントする。

 採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 9 月 24 日

1 投票

The data you have generates the following map plot -
maint = readtable('main towers.csv');
subt = readtable('subtower.csv');
%% IDs of the towers
%Main towers
id = maint.tower;
%Sub towers
subid = subt.subtower;
str = ["Latitude" "Longitude"];
figure
%Plot the main towers
geoplot(maint.(str(1)),maint.(str(2)),'b.','MarkerSize',15)
%Adjusted limits of the geographic map
geolimits([41.83 41.87],[12.6 12.65])
hold on
%Plot the coverage area i.e. subtowers
for k = 1:numel(id)
index = ismember(subid,id(k));
if nnz(index)
%Get the unique combination of Lat and Long coordinates for the subtowers
vec = unique(subt{index,str},'rows','stable');
%Make convex hull of the data
z = convhull(vec);
%Corresponding geographic polyshope
g=geopolyshape(vec(z,1),vec(z,2));
%Plot the coverage area
pg = geoplot(g,'FaceColor',rand(1,3),'FaceAlpha',0.3);
end
end

4 件のコメント

Sangesh Pv
Sangesh Pv 2023 年 9 月 24 日
its perfect, is there any way to know which which tower is which color? or an legend to identify the color of the range associated with the tower.
Dyuman Joshi
Dyuman Joshi 2023 年 9 月 24 日
%Reading the data
maint = readtable('main towers.csv');
subt = readtable('subtower.csv');
%% IDs of the towers
%Main towers
id = maint.tower;
%Sub towers
subid = subt.subtower;
%Colors for mapping
c = hsv(numel(id));
str = ["Latitude" "Longitude"];
ax=geoaxes;
hold on
%Plot the coverage area i.e. subtowers
for k = 1:numel(id)
index = ismember(subid,id(k));
if nnz(index)
%Get the unique combination of Lat and Long coordinates for the subtowers
vec = unique(subt{index,str},'rows','stable');
%Make convex hull of the data
z = convhull(vec);
%Corresponding geographic polyshope
g=geopolyshape(vec(z,1),vec(z,2));
%Plot the coverage area and add individual legends
geoplot(g,'FaceColor',c(k,:),'FaceAlpha',0.5,'DisplayName',sprintf('%d',id(k)));
end
end
%Legend
l=legend('AutoUpdate','off','FontSize',10,'Location','northeastoutside');
%Plot the main towers
geoscatter(maint.(str(1)),maint.(str(2)),[],c,'filled')
%Adjusted limits of the geographic map
geolimits([41.84 41.87],[12.6 12.65])
Sangesh Pv
Sangesh Pv 2023 年 9 月 24 日
thank you, you helped a lot
Dyuman Joshi
Dyuman Joshi 2023 年 9 月 25 日
Glad to have helped!
If my answer solved your problem, please consider accepting the answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGeographic Plots についてさらに検索

製品

リリース

R2023a

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by