-
Notifications
You must be signed in to change notification settings - Fork 228
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
POC: Code PyGMT logo in PyGMT #3849
base: main
Are you sure you want to change the base?
Conversation
/format |
I feel the logo definition should be separated into a standalone method, similar to the method to plot the GMT logo. This would allow to plot the PyGMT logo by calling something like |
ruff v0.10.0 was released 2 hours ago causing the newly falling code style checks. |
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
# Outer and inner radii of compass lines | ||
r1, r2 = size * 0.625, size * 0.325 |
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.
In fact, r1
/r2
are not radii but x/y coordinates.
I'm thinking if we should define a few variables for different radii, e.g.,
r0 = size # The outer radius of the blue circle
r1 = size * 0.875 # The inner radius of the blue circle
# When plotting the blue circle, the symbol size should be:
diameter = (r0+r1) / 2.0 * 2
# The pen thickness for the blue circle should be:
pen = r0 - r1
r2 = size * xxx # The outer radius of the compass line. Maybe this could be the same as the inner radius of the blue circle?
r3 = size * 0.4625 # The inner radius of the compass line
r4 = size * 0.4125 # Outer radius of the letter G
r5 = size * 0.29375 # Inner radius of the letter G
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.
I will try to find some time in the next days to give this a try 🙂.
# red line | ||
fig.plot(x=[0, 0], y=[4, 1.9], pen=f"12p,{color_red}", perspective=True) | ||
|
||
# ............................................................................. |
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.
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.
Oh, yeah letter M was a bit difficult to do ... And you are right using a polygon makes it easier to get perfect corners. I updated to code in commit b8d9e8c. So far the ratios are set manually, and not following any typography rules for letter M.
Old via lines | New via polygon |
---|---|
![]() |
![]() |
![]() |
![]() |
Description of proposed changes
Related to #1404 (comment), create the PyGMT logo in Python with PyGMT.
Figure.pygmtlogo
orFigure.logo_pygmt
as part of theFigure
class or addition to the methodFigure.logo
(which plots the GMT logo)Preview:
Related to
TODO:
shape="circle" | "hexagon"
orhex=False | True
Figure.image
)Figure
class or addition toFigure.logo
.Issues:
Figure
objects using the saved eps files. Maybe this is not easy to handle when converting to a method of theFigure
classe.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 command is:
/format
: automatically format and lint the code