Hi Everyone,
I am trying to create a legend, but instead of the default (as shown here) - I want to make it so that it looks like this https://docs.generic-mapping-tools.org/6.3/legend.html (so the magnitudes are horizontal).
Here is my code for the vertical legend:
import pygmt
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
pr_reg = [-120,-105,45,55]
gridfile = pygmt.datasets.load_earth_relief(resolution="15s", region=pr_reg)
fig = pygmt.Figure()
fig.grdimage(region=pr_reg, grid=gridfile, projection="M10c",
cmap="gray", frame=['WSen', "xa5.0f1.0", "ya2.0f1.0"],
transparency=20)
fig.coast(region=pr_reg, projection="T-117/10c", shorelines=True,
map_scale="-119/45.97/1/50+lkm")
## Mw scaled by size ##
mw1=0.04*(2**1)
mw1s='c'+str(mw1)+'c'
mw2=0.04*(2**2)
mw2s='c'+str(mw2)+'c'
mw3=0.04*(2**3)
mw3s='c'+str(mw3)+'c'
mw4=0.04*(2**4)
mw4s='c'+str(mw4)+'c'
mw5=0.04*(2**5)
mw5s='c'+str(mw5)+'c'
fig.plot(x=-110, y=50, style=mw1s,
color='white', pen='black', label='"Mw 1"')
fig.plot(x=-115, y=48, style=mw2s,
color='white', pen='black', label='"Mw 2"')
fig.plot(x=-118, y=51, style=mw3s,
color='white', pen='black', label='"Mw 3"')
fig.plot(x=-117.5, y=49, style=mw4s,
color='white', pen='black', label='"Mw 4"')
fig.plot(x=-107, y=52.5, style=mw5s,
color='white', pen='black', label='"Mw 5"')
fig.legend(position="x+6.5/0.1+o0.2c", box='+gwhite+p1p')
fig.show()
Any ideas on how to make the legend horizontal would be great
Thank you!