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

Figure.colorbar: Add aliases for L and Z #2357

Merged
merged 16 commits into from
Mar 4, 2023
Merged

Conversation

yvonnefroehlich
Copy link
Member

@yvonnefroehlich yvonnefroehlich commented Feb 9, 2023

Description of proposed changes
This PR aims to add aliases for pygmt.Figure.colorbar:

  • L -> equalsize (no hypen)
  • Z -> zfile

At the moment the aliases are orientated on the Julia documentation at https://www.generic-mapping-tools.org/GMTjl_doc/documentation/modules/colorbar/.

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@yvonnefroehlich yvonnefroehlich added the enhancement Improving an existing feature label Feb 9, 2023
@yvonnefroehlich yvonnefroehlich added this to the 0.9.0 milestone Feb 9, 2023
@yvonnefroehlich yvonnefroehlich self-assigned this Feb 9, 2023
@yvonnefroehlich
Copy link
Member Author

I am wondering whether it would be nice to update one or both of these two examples

to use equalsize (L) with pygmt.Figure.colorbar (in a separate PR).
What do @GenericMappingTools/pygmt-maintainers think about this change?

@seisman
Copy link
Member

seisman commented Feb 13, 2023

I am wondering whether it would be nice to update one or both of these two examples

to use equalsize (L) with pygmt.Figure.colorbar (in a separate PR). What do @GenericMappingTools/pygmt-maintainers think about this change?

I think adding L makes no changes to these examples.

@yvonnefroehlich
Copy link
Member Author

yvonnefroehlich commented Feb 14, 2023

I am wondering whether it would be nice to update one or both of these two examples

to use equalsize (L) with pygmt.Figure.colorbar (in a separate PR). What do @GenericMappingTools/pygmt-maintainers think about this change?

I think adding L makes no changes to these examples.

Hm. I was refering to this change of the colorbar via L or equalsize:

Color points by categories 3-D Scatter plots
current version colorbar() pygmt_pingues_colorbar pygmt_iris_colorbar
using colorbar(equalsize=0.7) pygmt_pingues_colorbar_L pygmt_iris_colorbar_L

But it's only a detail, and I am also fine with leaving these examples as is 🙂. Another possibility to show this option could be the example Colorbar?

@michaelgrund
Copy link
Member

Hm. I was refering to this change of the colorbar via L or equalsize:
Color points by categories 3-D Scatter plots
current version colorbar() pygmt_pingues_colorbar pygmt_iris_colorbar
using colorbar(equalsize=0.7) pygmt_pingues_colorbar_L pygmt_iris_colorbar_L

But it's only a detail, and I am also fine with leaving these examples as is slightly_smiling_face. Another possibility to show this option could be the example Colorbar?

From the context side it does not make any difference to use equalsize since the data is categorical and thus independent of the colorbar style with or without gaps between the categories. Maybe it's better to show that option in another example or in an potential short tutorial on how to use different styles of colorbars with PyGMT?

@yvonnefroehlich
Copy link
Member Author

Hm. I was refering to this change of the colorbar via L or equalsize:
But it's only a detail, and I am also fine with leaving these examples as is slightly_smiling_face. Another possibility to show this option could be the example Colorbar?

From the context side it does not make any difference to use equalsize since the data is categorical and thus independent of the colorbar style with or without gaps between the categories. Maybe it's better to show that option in another example or in an potential short tutorial on how to use different styles of colorbars with PyGMT?

Yes, sure, this is only an option how to display a colormap for categorical data 🙂.
In general, I am open for a short tutorial on how to use different styles of colorbar with PyGMT. But there is already the Gallery example Colorbar which covers several options on displaying colormaps.

@seisman
Copy link
Member

seisman commented Feb 16, 2023

In general, I am open for a short tutorial on how to use different styles of colorbar with PyGMT. But there is already the Gallery example Colorbar which covers several options on displaying colormaps.

I think it's OK if you want to improve the Colorbar example, but it can be done in a separate PR.

@yvonnefroehlich yvonnefroehlich added the needs review This PR has higher priority and needs review. label Mar 3, 2023
@yvonnefroehlich yvonnefroehlich changed the title WIP: pygmt.Figure.colorbar: Add aliases for L and Z pygmt.Figure.colorbar: Add aliases for L and Z Mar 4, 2023
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Mar 4, 2023
@seisman seisman merged commit 24f9639 into main Mar 4, 2023
@seisman seisman deleted the add-colorbar-aliases-L-Z branch March 4, 2023 15:42
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Mar 4, 2023
@seisman seisman changed the title pygmt.Figure.colorbar: Add aliases for L and Z Figure.colorbar: Add aliases for L and Z Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants