Add gallery example "Decorated lines" (style="~")#2564
Conversation
|
/format |
|
/format |
style="~")style="~")
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
|
Based on the upstream GMT documentation at https://docs.generic-mapping-tools.org/dev/plot.html#s it should be possible to rotate the symbol by appending +aangle:
However, so far this does not work for me (for quoted lines it works to rotate the label by appending +aangle). Code example: import pygmt
import numpy as np
size = 5
x = np.array([-size, size])
y = np.array([3, 3])
fig = pygmt.Figure()
fig.basemap(
region=[-size, size, -size, size],
projection="X" + str(size*2) + "c",
frame=True,
)
for i_line in [
"~d2c:+ss1c",
"~d2c:+ss1c+a20",
"qd1c:+ltext",
"qd1c:+ltext+a20",
]:
fig.plot(
x=x,
y=y,
style=i_line,
pen="1.25p,black",
)
fig.text(
x=0,
y=y[0]+0.7,
text=i_line,
font="10p",
)
y = y - 2
fig.show()
# fig.savefig(fname="decorated_lines_rotated.png") |
Likely an upstream bug or a missing feature. Please report to the upstream GMT repository. |
Please see issue GenericMappingTools/gmt#7591. |
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>

Description of proposed changes
This PR aims to add a gallery example showing how to generated "Decorated lines".
Upstream GMT documentation: https://docs.generic-mapping-tools.org/dev/plot.html#s
Related to:
style="f")style="q") #2563Preview: https://pygmt-dev--2564.org.readthedocs.build/en/2564/gallery/lines/decorated_lines.html
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash commands are:
/format: automatically format and lint the code/test-gmt-dev: run full tests on the latest GMT development version