Skip to content
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

Draft
wants to merge 168 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
2a319b7
Add first version of PyGMT code for PyGMT logo
yvonnefroehlich Mar 13, 2025
c4e683f
Remove execution permission
yvonnefroehlich Mar 13, 2025
0eb9044
Adjust tumbnail image
yvonnefroehlich Mar 13, 2025
4d2cc0e
Introduce input variable for adding wordmark and adjusting the orient…
yvonnefroehlich Mar 13, 2025
7c10e4a
Fix URL link
yvonnefroehlich Mar 13, 2025
135c4dc
Adjust saving (temp)
yvonnefroehlich Mar 13, 2025
8c6df7a
Adjust frame config
yvonnefroehlich Mar 13, 2025
11f230f
Remove execution permission
yvonnefroehlich Mar 13, 2025
dfd018a
Adjust length of diagonal lines
yvonnefroehlich Mar 13, 2025
a9e0503
Use corner for yellow line at right side of letter M
yvonnefroehlich Mar 13, 2025
c1679b3
Remove execution permission
yvonnefroehlich Mar 13, 2025
58cad71
Add space between horizontal line of letter G and letter M
yvonnefroehlich Mar 13, 2025
eb9c317
Add comment for distance between letters M and G
yvonnefroehlich Mar 13, 2025
5cc808e
Reduce white margin
yvonnefroehlich Mar 14, 2025
cdadee3
Remove execution permission
yvonnefroehlich Mar 14, 2025
6b91061
Add transparent option
yvonnefroehlich Mar 14, 2025
6a2e785
Remove execution permission
yvonnefroehlich Mar 14, 2025
9bbf443
Adjust yellow line ending at the right side of letter M
yvonnefroehlich Mar 14, 2025
945183b
Merge branch 'main' into code-pygmt-logo
yvonnefroehlich Mar 14, 2025
0aea0b0
Make clean border of shape
yvonnefroehlich Mar 14, 2025
80b9a48
Remove execution permission
yvonnefroehlich Mar 14, 2025
591f724
Subpress temporary show | Add frame 0
yvonnefroehlich Mar 14, 2025
c75397d
Remove execution permission
yvonnefroehlich Mar 14, 2025
1fbb090
Introduce box parameter
yvonnefroehlich Mar 14, 2025
b1d373a
Fix code style | Improve box querry
yvonnefroehlich Mar 14, 2025
39e5ba1
Remove execution permission
yvonnefroehlich Mar 14, 2025
8519275
Update variable name
yvonnefroehlich Mar 14, 2025
71185ee
Remove execution permission
yvonnefroehlich Mar 14, 2025
57d91bd
Convert to function
yvonnefroehlich Mar 14, 2025
93c9f05
Fix code style and add examples
yvonnefroehlich Mar 14, 2025
7cfea09
Code formating
yvonnefroehlich Mar 14, 2025
e9d1798
Remove execution permission
yvonnefroehlich Mar 14, 2025
dab45b9
Update examples
yvonnefroehlich Mar 14, 2025
67b13be
Remove execution permission
yvonnefroehlich Mar 14, 2025
0fe36d3
Remove withe margin |Use box parameter of Figure.image
yvonnefroehlich Mar 14, 2025
5e19702
Follow coding style
yvonnefroehlich Mar 14, 2025
1d07537
Remove execution permission
yvonnefroehlich Mar 14, 2025
432d6cf
Minor updates | add examples
yvonnefroehlich Mar 14, 2025
725126d
Remove execution permission
yvonnefroehlich Mar 14, 2025
361e3aa
Remove unneeded docs
yvonnefroehlich Mar 14, 2025
9c9d19f
Remove unneeded parameters from examples
yvonnefroehlich Mar 14, 2025
9f1e812
Remove execution permission
yvonnefroehlich Mar 14, 2025
789d82e
Improve names of parameters
yvonnefroehlich Mar 14, 2025
b38edf9
Remove execution permission
yvonnefroehlich Mar 14, 2025
c8c7f79
Update parameter list explanaition
yvonnefroehlich Mar 14, 2025
ff04635
Remove execusion permission
yvonnefroehlich Mar 14, 2025
32c5341
Fix typo
yvonnefroehlich Mar 14, 2025
b079fd9
Fix rst syntax
yvonnefroehlich Mar 15, 2025
90a2890
Use variables for colors
yvonnefroehlich Mar 15, 2025
4c6013e
Introduce transpareny for wordmark
yvonnefroehlich Mar 15, 2025
f8ac7c0
Follow code style
yvonnefroehlich Mar 15, 2025
bdb6f14
Adjustments for tranparency for wordmark
yvonnefroehlich Mar 15, 2025
7416979
Remove execution permission
yvonnefroehlich Mar 15, 2025
ebdf4f2
Adjust example
yvonnefroehlich Mar 15, 2025
6d01ec1
Remove execution permission
yvonnefroehlich Mar 15, 2025
a60a88c
Add comment as reminder
yvonnefroehlich Mar 15, 2025
ec4583c
Remove execution permission
yvonnefroehlich Mar 15, 2025
4891de2
Combine box and bg_transparent to box parameter of Figure.image
yvonnefroehlich Mar 15, 2025
e3da0ce
Simplify code
yvonnefroehlich Mar 15, 2025
78872b4
Adjust outline
yvonnefroehlich Mar 15, 2025
470ed44
Try to use GMT color setting for font
yvonnefroehlich Mar 15, 2025
e77dde2
Remove unneeded code
yvonnefroehlich Mar 15, 2025
126a574
Remove execution permission
yvonnefroehlich Mar 15, 2025
5de8969
Polish code
yvonnefroehlich Mar 15, 2025
77c12f8
Follow code style
yvonnefroehlich Mar 15, 2025
76e1dac
Remove execution permission
yvonnefroehlich Mar 15, 2025
366970a
Use specific variable names
yvonnefroehlich Mar 15, 2025
43d6d92
Remove execution permission
yvonnefroehlich Mar 15, 2025
e401fea
Do rotation directly not eps export
yvonnefroehlich Mar 15, 2025
cbe6035
Remove execution permission
yvonnefroehlich Mar 15, 2025
e060bc7
Make full transparent
yvonnefroehlich Mar 15, 2025
d46d5e0
Use dicts
yvonnefroehlich Mar 15, 2025
cd38f53
Remove execution permission
yvonnefroehlich Mar 15, 2025
e8dd40c
Suppress code style fails because of to many statements PLR0915
yvonnefroehlich Mar 15, 2025
87dd5b7
Remove execution permission
yvonnefroehlich Mar 15, 2025
5f492d7
Add size of logo | add GMT in example | Polish code
yvonnefroehlich Mar 15, 2025
b8150a5
Follow code style
yvonnefroehlich Mar 15, 2025
8355de0
Plot yellow lines via loop over list
yvonnefroehlich Mar 15, 2025
7d382b0
Remove execution permission
yvonnefroehlich Mar 15, 2025
ff512cc
Plot red lines for letter M via loop over list
yvonnefroehlich Mar 15, 2025
c072743
Adjust variable name
yvonnefroehlich Mar 15, 2025
5962954
Use dict
yvonnefroehlich Mar 15, 2025
5175a28
Reduce number of branches to be not > 12
yvonnefroehlich Mar 15, 2025
3768a06
Remove execution permission
yvonnefroehlich Mar 15, 2025
433f8e4
Improve comments
yvonnefroehlich Mar 15, 2025
479f4a2
Remove execution permission
yvonnefroehlich Mar 15, 2025
4f9ae6f
Do not rotate initial basemap -> no need of resize in savefig
yvonnefroehlich Mar 15, 2025
08c7e56
Follow code style
yvonnefroehlich Mar 15, 2025
8cb9079
Remove execution permission
yvonnefroehlich Mar 15, 2025
d2f479d
No temp eps file for wordmark
yvonnefroehlich Mar 15, 2025
f304d49
Adjust position and font size for wordmark based on orientation
yvonnefroehlich Mar 15, 2025
f7a84c5
Follow code style
yvonnefroehlich Mar 15, 2025
b18f816
Comment code
yvonnefroehlich Mar 15, 2025
5ff52a8
Remove execution permission
yvonnefroehlich Mar 15, 2025
9297ac5
Adjust position of wordmark
yvonnefroehlich Mar 15, 2025
50e361b
Remove execution permission
yvonnefroehlich Mar 15, 2025
09471e8
Create pygmtlogo.py in src and move code
yvonnefroehlich Mar 16, 2025
0a35459
Update __init__.py
yvonnefroehlich Mar 16, 2025
b4259ad
Update figure.py
yvonnefroehlich Mar 16, 2025
06fbfbd
Update gallery exampel
yvonnefroehlich Mar 16, 2025
c9c9d75
Add Docstrings
yvonnefroehlich Mar 16, 2025
efff204
Fix import in Gallery example
yvonnefroehlich Mar 16, 2025
7779832
Update index
yvonnefroehlich Mar 16, 2025
79500dd
Update gallery example
yvonnefroehlich Mar 16, 2025
7f9d57e
Update imports
yvonnefroehlich Mar 16, 2025
2132e5e
Add tests
yvonnefroehlich Mar 16, 2025
438a100
Follow code style
yvonnefroehlich Mar 16, 2025
cb854e3
Update docs
yvonnefroehlich Mar 16, 2025
3d40b6a
Remove exectuion permission
yvonnefroehlich Mar 16, 2025
d81c077
Remove exection permission
yvonnefroehlich Mar 16, 2025
2696234
Remove execution permission
yvonnefroehlich Mar 16, 2025
c9262cc
Update docstrings
yvonnefroehlich Mar 16, 2025
5999c51
Follow rules for variable names and use no space between consonants
yvonnefroehlich Mar 16, 2025
4121569
Reduce galler example
yvonnefroehlich Mar 16, 2025
16eb3dc
Expand tests
yvonnefroehlich Mar 16, 2025
6d71dc3
Set box default to None
yvonnefroehlich Mar 17, 2025
e8c693e
Plot without setting up basemap
yvonnefroehlich Mar 17, 2025
dcc38e1
Merge branch 'main' into code-pygmt-logo
yvonnefroehlich Mar 17, 2025
1a2ca98
Add more parameters
yvonnefroehlich Mar 17, 2025
d716bd5
Exclude PLR0913
yvonnefroehlich Mar 17, 2025
59dff81
Update tests
yvonnefroehlich Mar 17, 2025
d35c445
Use default position=Non
yvonnefroehlich Mar 18, 2025
13306c8
Remove blank line
yvonnefroehlich Mar 18, 2025
78ea05a
Move function create_logo out of function pygmtlogo
yvonnefroehlich Mar 18, 2025
7910e05
Merge branch 'main' into code-pygmt-logo
yvonnefroehlich Mar 18, 2025
6ec39e7
Adjust defaults
yvonnefroehlich Mar 20, 2025
787530d
Update gallery example
yvonnefroehlich Mar 20, 2025
7601e93
Fix typo
yvonnefroehlich Mar 20, 2025
ec13d17
Merge branch 'main' into code-pygmt-logo
yvonnefroehlich Mar 20, 2025
1f1bfd9
Adjust gallery example
yvonnefroehlich Mar 21, 2025
1b51c05
Adjust docstring
yvonnefroehlich Mar 21, 2025
ebcf510
Fix typo
yvonnefroehlich Mar 21, 2025
9dbf096
Update docstrings
yvonnefroehlich Mar 26, 2025
b07fe8c
Include 'orientation' parameter into 'wordmark' parameter
yvonnefroehlich Mar 26, 2025
ea9e9e0
Update gallery example
yvonnefroehlich Mar 26, 2025
33a91b1
Merge branch 'main' into code-pygmt-logo
yvonnefroehlich Mar 26, 2025
4bb45af
Do not plot invisible basemap at the beginning
yvonnefroehlich Mar 26, 2025
33517d6
Remove un-needed variable
yvonnefroehlich Mar 26, 2025
f7e5cd6
Fix variable name after renaming for coding style
yvonnefroehlich Mar 26, 2025
11b9a49
Remove un-needed comment
yvonnefroehlich Mar 26, 2025
95aee4f
Remove un-needed code block
yvonnefroehlich Mar 26, 2025
d4c17ae
Fix code style
yvonnefroehlich Mar 26, 2025
3cdd4f3
Update intro text of gallery example
yvonnefroehlich Mar 26, 2025
38e15f7
Update docs
yvonnefroehlich Mar 26, 2025
2f6decb
Use fixed angle for rotation -> remove variable
yvonnefroehlich Mar 27, 2025
eaa6e12
Shorten variable names
yvonnefroehlich Mar 27, 2025
85d09d2
Shorten variable names for compass lines
yvonnefroehlich Mar 27, 2025
a994624
Merge branch 'main' into code-pygmt-logo
yvonnefroehlich Mar 27, 2025
8116295
Remove un-needed string f
yvonnefroehlich Mar 27, 2025
a50ebfd
Update parameter names
yvonnefroehlich Mar 27, 2025
f0f7fbd
Update gallery example
yvonnefroehlich Mar 27, 2025
6d360d3
Improve docs
yvonnefroehlich Mar 27, 2025
b74eb73
Fit code in one line
yvonnefroehlich Mar 27, 2025
0cec697
Fit code in one line
yvonnefroehlich Mar 27, 2025
eaed88a
Fix comments
yvonnefroehlich Mar 27, 2025
3b8f3d7
Improve comment
yvonnefroehlich Mar 27, 2025
28e79ae
Fix typo
yvonnefroehlich Mar 27, 2025
b766c1b
Fix length
yvonnefroehlich Mar 27, 2025
62a70b8
Remove un-used 'no_clip' parameter
yvonnefroehlich Mar 28, 2025
d01531f
Remove un-needed 'no_clip' parameter
yvonnefroehlich Mar 28, 2025
5086e11
Adjust variable name
yvonnefroehlich Mar 28, 2025
b969a82
Remove un-needed 'no_clip' parameter
yvonnefroehlich Mar 28, 2025
d4effc4
Add 'no_clip' parameter back for hexagon shape
yvonnefroehlich Mar 29, 2025
9732287
Merge branch 'main' into code-pygmt-logo
yvonnefroehlich Mar 29, 2025
c78b2f3
Add 'no_clip' parameter back for hexagon shape
yvonnefroehlich Mar 29, 2025
0867085
TEST Add invisible basemap back to also have a square for hexagon shape
yvonnefroehlich Mar 29, 2025
77636b6
Adjust size of basemap in all combination test plot
yvonnefroehlich Mar 29, 2025
229046c
Fix syntax and use maximum line lenght
yvonnefroehlich Mar 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor updates | add examples
yvonnefroehlich committed Mar 14, 2025
commit 432d6cf9e6569abe5e317e49b6adb397754904b0
25 changes: 23 additions & 2 deletions examples/gallery/embellishments/pygmt_logo.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ def create_logo(
bg_transparent=bg_transparent,
):
# -----------------------------------------------------------------------------
# Not-changebale settings (-> need to extended)
# Not-changebale settings
# -----------------------------------------------------------------------------
size = 4
region = [-size, size] * 2
@@ -106,7 +106,7 @@ def create_logo(
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fig = pygmt.Figure()
pygmt.config(MAP_FRAME_PEN="cyan@100")
fig.basemap(region=region, projection=f"X{size * 2}c", frame=[0, "+gcyan@100"])
fig.basemap(region=region, projection=f"X{size * 2}c", frame="+gcyan@100")

# .............................................................................
# blue circle / hexagon for Earth
@@ -316,6 +316,27 @@ def create_logo(
#
# Limitations: works only for a PyGMT Figure instance named "fig"


fig = pygmt.Figure()
pygmt.config(MAP_FRAME_PEN="cyan@100")
fig.basemap(region=[-5, 5, -5, 5], projection="X10c", frame="+gcyan@100")

pygmtlogo(bg_concept="dark", position="jMC+w10c", wordmark=False, bg_transparent=True)

fig.show()

# %%

fig = pygmt.Figure()
pygmt.config(MAP_FRAME_PEN="cyan@100")
fig.basemap(region=[-5, 5, -5, 5], projection="X10c/2c", frame="+gcyan@100")

pygmtlogo(bg_concept="light", position="jMC+w10c")

fig.show()

# %%

fig = pygmt.Figure()
fig.basemap(region=[-5, 5, -5, 5], projection="X10c", frame=[1, "+gtan"])