[Need help with] GMT Eumap with lines and dots

I would like to plot a series of lines and dots on the map of the EU ; I found out how to plot the EU map and plot either (one line) or a bunch of dots, but it is unclear to me how to do both ; I also would like to be able to toggle the colour of each line according to some numeric data (say colour coded from scales of green to red or other temperature map)

Code with one line showing

coast(
region=β€œ-10/35/4/45+r”,
proj=(name=:laea, center=[3,39]),
frame=:ag,
res=:full,
area=500,
shore=:thin,
rivers=:thin,
borders=1,

# outline spain in red
DCW=((country="ES", 
        pen=(1,:red))),
figsize=50

)

latt = bus_data.x
long = bus_data.y

GMT.lines!(
[long[1],long[1235]],[latt[1],latt[1235]],
fmt=:png,
lw=2,
pen=(1,:red),
aspect=:equal,
show=true
)

code with dots showing

coast(
region=β€œ-10/35/4/45+r”,
proj=(name=:laea, center=[3,39]),
frame=:ag,
res=:full,
area=500,
shore=:thin,
rivers=:thin,
borders=1,

# outline spain in red
DCW=((country="ES", 
        pen=(1,:red))),
figsize=50

)

latt = bus_data.x
long = bus_data.y

GMT.scatter!(
long, latt,
fmt=:png,
marker=:circle,
markeredgecolor=0,
size=0.5,
markerfacecolor=:cyan,
show=true
)

But putting both GMT.lines! and GMT.scatter! produces an error

It is very hard to read the code due to the formatting. Will you please try to make a reply where the code is formatted such that it can be copied into an editor. You can look at other discourse post to see how they post the Minimal Working Examples (MWE).

@joa-quim is the author of GMT.jl and he is normally active on discourse.

1 Like

You also need to post the error message. And preferably an example that we can reproduce. On a glace I see no obvious error (by markeredgecolor=0 you mean markeredgecolor=:black?) but I don’t know what is long and latt.

The second example here shows how to color lines according some third variable.