Dear all, I would be grateful if you can tell me how I can create a 0.5 x 0.5 box around each point that I have. I want each point to be the center of the box, in fact.
Here is the list of my points which include latitude and longitude of them.
For example:
scatter(Points.lon, Points.lat, '.') % lon is x and lat is y

 Réponse acceptée

KSSV
KSSV le 4 Août 2020

2 votes

This question can be solved from your previous question which was answered.
If (x,y) is your point and you want points around it as center.
% given point is (x,y) , make a bounding box around it
x = rand ; y = rand ;
% generate points for box
P = [x-0.5 y-0.5 ; x-0.5 y+0.5 ; x+0.5 y+0.5 ; x+0.5 y-0.5 ; x-0.5 y-0.5] ;
% plot
plot(x,y,'*r')
hold on
plot(P(:,1),P(:,2),'b')

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Produits

Version

R2020a

Tags

Question posée :

BN
le 4 Août 2020

Commenté :

BN
le 5 Août 2020

Community Treasure Hunt

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

Start Hunting!

Translated by