Adding a Border to my map using Mapping Toolbox
10 views (last 30 days)
Show older comments
Hi,
So my problem is on the map below. I am using the France map thanks to the mapping toolbox, however, I can't find a way to put a proper border. I have drawn myself the dark line for now, and i know i can add more point to make it better, but i want to know if there is a way to import other data/something else to get it better. The code is below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1254352/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1254357/image.png)
Moreover, I'd like to know if in general, i can import a map from the internet, like a picture, and superimpose it to my map, for example, the map below. I would just need the color, but i admit it would be easier to import it than create hundred of points to make it myself.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1254362/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1254362/image.png)
Thank you for your responses!
0 Comments
Accepted Answer
Cameron
on 6 Jan 2023
Here's a start. I saved the picture you posted as "image.png". You may have to adjust the fig.Position vector to size it correctly. You also might want to select a picture that doesn't have a black background.
fig = figure;
ax = axes(fig);
img = imread('image.png');
yLimits = [0 1000]; %you can make this your longitude
xLimits = [0 500]; %you can make this your latitude
image('CData',img,'XData',xLimits,'YData',flip(yLimits))
hold on
x = randi(xLimits,10,20); %some random x data
y = randi(yLimits,10,20); %some random y data
p = scatter(x,y,'ro','filled');
hold off
axis tight
0 Comments
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!