Plot a box around set of points
27 views (last 30 days)
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.
scatter(Points.lon, Points.lat, '.') % lon is x and lat is y
KSSV on 4 Aug 2020
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] ;