0
$\begingroup$

I have 2 lists (data1,data2) of Lat/Lon-values from a SQL database. With GeoPosition[data1] resp. GeoPosition[data2] I have now two GeoPosition objects. I want to show all data points within a map via GeoListPlot. This works but all points have the same color. How can I change the color for the first list to blue and for the second list to red?

regards Volker


Thank you, Alexey and David, for the help. This works, although a internet connection is needed. @Kuba: sorry, you are right, it was rather short. For clarification: Step 1: getting lat/lon-pairs from a database into 2 different lists data1 and data2 Step 2: convert the lists into geoposition objects with gdata1 = GeoPosition[data1] and gdata2 = GeoPosition[data2] Step 3: GeoListPlot[{gdata1, gdata2}] yields to an error message "Coordinate {{8.786667, 62.80830897297128}, {7.1427439999999995, 59.26734059658699}, {6.766774999999999, 59.941481559066624}, {7.684830999999999, 61.3055909134758}, {12.241633, 60.170487617305945`}} should be a pair of numbers, or a Scaled or Offset form." and a second one for gdata2. Step 4: GeoListPlot[gdata1] resp. GeoListPlot[gdata2] produced two maps with the plotted points. Problem: bring them together into just one map, the points from gdata1 in one color, those from gdata2 in another color.

Thank you for help Volker

$\endgroup$
  • 3
    $\begingroup$ Please provide a minimal working example. p.s. isn't GeoListPlot[{list1, list2}] enough? $\endgroup$ – Kuba Mar 17 '17 at 8:51
1
$\begingroup$

You need PlotStyle -> {Red, Green} or other specification.

GeoListPlot[{{Entity["Country", "Canada"], 
   Entity["Country", "Mexico"]}, {Entity["Country", "Egypt"]}}, Joined -> True, 
 PlotStyle -> {Directive[Blue, Dashed, EdgeForm[{Green, Thick}], Opacity[1]], 
   Directive[Red, Opacity[.2], EdgeForm[{Thick, Black, Dashed}]]}]
| improve this answer | |
$\endgroup$
  • $\begingroup$ I converted your boxes into InputForm by applying InputForm to the first argument of the GeoListPlot. $\endgroup$ – Alexey Popkov Mar 17 '17 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.