Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Aug 10, 2025

Modifiers PyGMT GMT GMT.jl
[g|j|J|n|x]<refpoint>[+j<justify>][+o<dx>[/<dy>]] position - -
+w<length>[/<width>]] length/width size size
[+e[b|f][<length>]] fg_triangle/bg_triangle/triangle_height triangles triangles
[+h|v] oriention="horizontal" or "vertical" horizontal,vertical horizontal
[+n|N[<txt>]] nan/nan_position nan nan
[+r] reverse reverse Give a negative length to reverse the scale bar

References

Preview: https://pygmt-dev--4048.org.readthedocs.build/en/4048/api/generated/pygmt.Figure.colorbar.html#pygmt.Figure.colorbar

Copy link
Member

@yvonnefroehlich yvonnefroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it would be good to add an alias for -S,

-S[+aangle][+c|n][+r][+s][+xlabel][+yunit]

as I realized that this flags allows to set x and y labels in case frame (-B) cannot be used, e.g., if equalsize (-L) is used.
I am wondering if adding an alias, e.g., appearance, using the old alias system still makes sense or if we should do this directly using the new alias system to introduce aliases for the single modifieres.

@seisman seisman added the enhancement Improving an existing feature label Sep 18, 2025
@seisman seisman added this to the 0.18.0 milestone Sep 18, 2025
@seisman seisman changed the base branch from main to params/position December 7, 2025 15:57
Base automatically changed from params/position to main December 11, 2025 01:54
@seisman seisman changed the title WIP: Figure.colorbar: Refactor using the new alias system Figure.colorbar: Refactor using the new alias system Dec 15, 2025
@seisman seisman added the needs review This PR has higher priority and needs review. label Dec 16, 2025
@seisman seisman force-pushed the refactor/colorbar branch 2 times, most recently from 0607414 to c892202 Compare December 19, 2025 12:23
@seisman seisman changed the title Figure.colorbar: Refactor using the new alias system Figure.colorbar: Add position/length/width and more parameters to specify colorbar positiona and properties Dec 19, 2025
@seisman seisman mentioned this pull request Dec 29, 2025
30 tasks
@seisman seisman marked this pull request as ready for review December 31, 2025 00:28
Copy link
Member

@yvonnefroehlich yvonnefroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small typo for now, will look at this PR in detail today or tomorrow.

Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
@weiji14 weiji14 changed the title Figure.colorbar: Add position/length/width and more parameters to specify colorbar positiona and properties Figure.colorbar: Add position/length/width and more parameters to specify colorbar position and properties Jan 6, 2026
Comment on lines 101 to 102
nan_rectangle: bool | str = False,
nan_rectangle_position: Literal["start", "end"] | None = None,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps shorter names nan and nan_position are better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think nan_position (or nan_side) is fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed them to nan/nan_position in 57f8c39.

Comment on lines 103 to 104
sidebar_triangles: bool | Literal["foreground", "background"] = False,
sidebar_triangles_height: float | None = None,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names are also a little too long. It's also unclear what sidebar means. What about fg_triangle/bg_triangle and triangle_height?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that these names are a bit long. fg_trinagle and bg_triangle would mean we have two parameters, correct? Maybe cb_triangles; "cb" for "colorbar", which is clearer as "sidebar"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel cb_triangles is a bad name for two reasons:

  • It's unclear what cb stands for
  • This is a parameter for Figure.colorbar, so the prefix cb (short for colorbar) is a little duplicate

Copy link
Member Author

@seisman seisman Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about fgcolor/bgcolor, which fgcolor=True/bgcolor=True means draw a triangle for foreground/background color.

fgcolor/bgcolor are also used in the Pattern class, but it takes a color, not a boolean value.

Edit: fgcolor/bgcolor may be good names, but it would be unclear what triangle_height means.

So, I still prefer fg_triangle/bg_triangle/triangle_height.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed them to fg_triangle/bg_triangle/triangle_height in 405383c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature needs review This PR has higher priority and needs review.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants