# How to plot points with error circles on map with latitude/longitude grid

I am currently working on a project to model the location of icebergs in the northwest atlantic. When an iceberg is sighted, an error circle is plotted around it (with a bivariate normal probability distribution), with a radius of 30 nautical miles.

My question is two-fold.

1. How can I plot latitude and longitude lines in mathematica, with the lat/long point of the iceberg with the circle around it)

2. Knowing the latitude and longitude of the center of an iceberg (i.e., the center of the circle with radius 30 nautical miles), how can I calculate how much probability is in each 1x1 degree section

Please the attached picture for amplifying information.

Any light you can shed on this would be very helpful, thank you! Let me know if you need anymore information. • fyi mathematic has built in geodetic mapping capability, see GeoGridPosition. I started working up an answer but I'm not sure if you care about that level of detail but rather just want a rectangular grid. – george2079 Feb 17 '15 at 22:34

For question 1, with Mathematica 10.0.2, as an example, let's get the current icebergs from Antartica, as reported by US National Ice Center.Graph all icebergs with remarks amerw*

icebergs =
Import["http://www.natice.noaa.gov/pub/icebergs/Iceberg_Tabular.\
csv"];
titles = First@icebergs; icebergs = Drop[Rest@icebergs, -1];
GeoGraphics[{Text[#[], GeoPosition[{#[], #[]}]], Red,
GeoDisk[{ToExpression@#[], ToExpression@#[]},
Quantity[30, "NM"]]} & /@
Cases[icebergs, {_, _, _, _, _,
b_ /; StringMatchQ[b, "amerw" ~~ ___], _}],
GeoGridLines -> Automatic, GeoProjection -> {"Bonne"}] • I actually don't have an answer but I am working on something similar. Zviovich, do you know if they have a function like this for Mathematica 9? – user26444 Feb 18 '15 at 2:07
• @KittyKat24 Geographic Computation is new to Mathematica 10 wolfram.com/mathematica/new-in-10/geographic-computation – Zviovich Feb 18 '15 at 14:04
• there is some capability in older versions , see GeoPosition for example. No GeoGraphics though. – george2079 Feb 18 '15 at 15:07
• @Zviovich, do you mind explaining what each line of code is doing in your answer? I have a csv file similar to the one you import and I'm thinking I can do something very similar. Thank you! – lwcarani Feb 19 '15 at 1:19

The probability mass over a specified support (region on your map) can be visualized by using RegionFunction[] as such:

{μx, μy} = {0, 0};
Plot3D[
PDF[MultinormalDistribution[{μx, μy}, {{1, 0}, {0, 1}}], {x, y}],
{x, -2, 2}, {y, -2, 2},
RegionFunction -> Function[{x, y}, 1 < x < 2 && 0 < y < 1],
PlotRange -> {0, Automatic}] The numerical probability can be computed using NProbability[]:

NProbability[1 < x < 2 ∧ 0 < y < 1, {x, y} \[Distributed] MultinormalDistribution[{0, 0}, {{1, 0}, {0, 1}}]]


(* 0.0463905 *)

A simple circle can be added to your plot of the region using

Epilog -> Circle[{μx, μy}, 30]


where 30 is the radius (in miles) of the circle you seek, which will likely need to be scaled based on your fundamental plot units. If you want a density plot, try this:

{μx, μy} = {0, 0};
DensityPlot[
PDF[MultinormalDistribution[{μx, μy}, {{1, 0}, {0, 1}}], {x, y}],
{x, -2, 2}, {y, -2, 2},
Mesh -> Automatic,
Epilog -> {Red, Circle[{μx, μy}, 1]}] 