-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gallery example "Decorated lines" (style="~"
)
#2564
Conversation
/format |
/format |
style="~"
)style="~"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Co-authored-by: Dongdong Tian <[email protected]>
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. |
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 format
andmake check
to 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